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

Author Topic: Documentation mistakes  (Read 4278 times)

0 Members and 1 Guest are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Documentation mistakes
« 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:
  • sf::Shader::SetParameter()
    Vector3f overload: "Change a 2-components vector parameter of the shader."

  • sf::InputStream::Seek()
    "seeked" -> "sought"

  • sf::ThreadLocalPtr
    Two times void Thread1(void*) in example code

  • sf::Image::GetPixelsPtr()
    "the returned pointer may become invalid if you modify the image, so you should never store it for too long."
    Single pixels are allowed to change, and only resize/reload is a problem, right?
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
Documentation mistakes
« Reply #1 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.
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Documentation mistakes
« Reply #2 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)
{
}
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
Re: Documentation mistakes
« Reply #3 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.
Laurent Gomila - SFML developer

 

anything