1
Graphics / Re: Creating a Vector of Shapes
« on: January 12, 2014, 05:25:53 am »
It works fine for SFML 2.0. Are you using a different version?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Is it possible to find out how many bytes an sf::Mutex takes up on each platform?
On Unix systems sf::Mutex contains a pthread_mutex_t object which size should be 40bytes.
On win32 systems it contain a CRITICAL_SECTION object which has 24bytes.
AlexAUT
With so many entities, it is highly unlikely that the same entity will be processed by multiple systems at any given time. Since all logic goes in systems, and systems can only communicate via thread-safe events, I think it might be feasible.
Given that 1 million windows CRITICAL_SECTIONs lock and unlock operations takes only 23.5 nanoseconds, I think the mutex overhead will be negligible. http://preshing.com/20111124/always-use-a-lightweight-mutex/
And finally, I'm just experimenting, having fun, and learning. Besides, someone has to at least attempt it
It is a namespace like std. Useusing namespace sf;if it bothers you.
Never use "using namespace" for any namespace. It is widely considered bad practice due to causing namespace collisions and the fact that the namespace clarifies where a function/class/etc is coming from, making code a bit easier to understand and making it easier to find the proper documentation for a function/class/etc.