SFML community forums
General => SFML website => Topic started by: Nexus on September 14, 2010, 11:28:07 pm
-
Just a few things I've stumbled upon:
sf::Mutex[/url]"]When a thread is locked by a thread, any other thread trying to lock it will be blocked until the mutex is released by the thread that locked it.
I think it should be "mutex" instead of "thread".
sf::Vector2[/url] and sf::Vector3 (http://www.sfml-dev.org/documentation/2.0/classsf_1_1Vector3.htm#ee8be1985c6e45e381ad4071265636f9)"]Default constructor.
It might be useful to specify that the default constructor creates a zero vector. Although this is assumable, it may be not obvious to SFML beginners.
sf::Shape[/url]"]It is important to keep in mind that shapes must always be convex
As you, Laurent, pointed out some time ago, it needn't necessarily be convex. It's okay if every polygon point is directly connected to the center (the connecting line is completely inside the polygon). For example, regular stars can be represented using sf::Shape, although they are concave.
sf::Font[/url]"]bool sf::Font::LoadFromMemory (const void * data, std::size_t sizeInBytes)
Load the font from a file.
It should be rather "memory".
Network - Using and extending packets[/url]"]Like I just said earlier, primitive C++ types such as unsigned int, char, etc. have a size which is not fixed and may vary depending on the platform.
char is probably not the best example, since it is guaranteed that sizeof(char) == sizeof(unsigned char) == sizeof(signed char) == 1 for all platforms.
Network - Using a selector[/url]"]bool ReceiveWithTimeout(sf::SocketTCP Socket, sf::Packet& Packet, float Timeout = 0)
Is the copy by value intended?
-
I think it should be "mutex" instead of "thread".
It might be useful to specify that the default constructor creates a zero vector. Although this is assumable, it may be not obvious to SFML beginners.
It should be rather "memory".
char is probably not the best example, since it is guaranteed that sizeof(char) == sizeof(unsigned char) == sizeof(signed char) == 1 for all platforms.
Fixed.
As you, Laurent, pointed out some time ago, it needn't necessarily be convex. It's okay if every polygon point is directly connected to the center (the connecting line is completely inside the polygon). For example, regular stars can be represented using sf::Shape, although they are concave.
That's right. However this is a consequence of the implementation, not a feature; maybe some day I'll stop using a triangle strip to render sf::Shapes and then non-convex shapes will stop working.
Is the copy by value intended?
Yes, in SFML 1 sockets have copy semantics. Manipulating a sf::Socket is similar to manipulating directly the internal SOCKET handle, which is an integer.
Thank you very much for your feedback :)
-
That's right. However this is a consequence of the implementation, not a feature; maybe some day I'll stop using a triangle strip to render sf::Shapes and then non-convex shapes will stop working.
Ah, okay. That's good to know, I was already about to make code dependent on that "feature".
At least, when using this nice implementation side-effect, I am now aware that it might not last forever. ;)