SFML community forums

General => SFML website => Topic started by: Nexus on January 21, 2012, 11:41:38 am

Title: Documentation mistakes
Post by: Nexus on January 21, 2012, 11:41:38 am
Hello, I suggest to collect errors spotted in the documentation, tutorials or other parts of the website in this thread, so that we don't have to create new threads or even GitHub issues.

They are all tiny mistakes/ideas, I start with a short list:
Title: Documentation mistakes
Post by: Laurent on January 21, 2012, 11:57:11 am
Good idea :)

And don't hesitate to suggest improvements, not only fixes.

Quote
sf::Shader::SetParameter()
sf::InputStream::Seek()
sf::ThreadLocalPtr

Done.

Quote
sf::Image::GetPixelsPtr()

The documentation shouldn't be too precise, I prefer if people call this function whenever they need to access the pixels, instead of storing the returned pointer while still calling SetPixel/GetPixel.
Title: Re: Documentation mistakes
Post by: Nexus on April 14, 2012, 11:56:34 am
Another unimportant advice: In sf::Vertex and sf::RenderStates constructors, you call the parameters thePosition, theTexture etc. I assume you did that to avoid name collisions with the members, but in fact there are none.

This is valid and defined C++, the members are correctly initialized:
Vertex::Vertex(const Vector2f& position, const Color& color, const Vector2f& texCoords) :
position (position),
color    (color),
texCoords(texCoords)
{
}
Title: Re: Documentation mistakes
Post by: Laurent on April 14, 2012, 12:33:18 pm
Yep, but gcc triggers a warning for it with -Wshadow. And it might really be dangerous anyway, so it's a good habit to start avoid it.