Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Minor documentation and tutorial remarks  (Read 4875 times)

0 Members and 1 Guest are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Minor documentation and tutorial remarks
« on: September 14, 2010, 11:28:07 pm »
Just a few things I've stumbled upon:

Quote from: "SFML 2 Documentation - [url=http://www.sfml-dev.org/documentation/2.0/classsf_1_1Mutex.htm
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".

Quote from: "SFML 2 Documentation - [url=http://www.sfml-dev.org/documentation/2.0/classsf_1_1Vector2.htm#58c32383b5291380db4b43a289f75988
sf::Vector2[/url] and sf::Vector3"]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.

Quote from: "SFML 2 Documentation - [url=http://www.sfml-dev.org/documentation/2.0/classsf_1_1Shape.htm
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.

Quote from: "SFML 2 Documentation - [url=http://www.sfml-dev.org/documentation/2.0/classsf_1_1Font.htm#0fc12ebb5aa620ac9673f3739358e93f
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".

Quote from: "SFML 1.6 Tutorial - [url=http://www.sfml-dev.org/tutorials/1.6/network-packets.php
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.

Quote from: "SFML 1.6 Tutorial - [url=http://www.sfml-dev.org/tutorials/1.6/network-selector.php
Network - Using a selector[/url]"]bool ReceiveWithTimeout(sf::SocketTCP Socket, sf::Packet& Packet, float Timeout = 0)
Is the copy by value intended?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Minor documentation and tutorial remarks
« Reply #1 on: September 14, 2010, 11:50:39 pm »
Quote
I think it should be "mutex" instead of "thread".

Quote
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.

Quote
It should be rather "memory".

Quote
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.

Quote
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.

Quote
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 :)
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Minor documentation and tutorial remarks
« Reply #2 on: September 15, 2010, 12:05:26 am »
Quote from: "Laurent"
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. ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything