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

Author Topic: better comment for sf::RenderWindow::SetView  (Read 14607 times)

0 Members and 1 Guest are viewing this topic.

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
better comment for sf::RenderWindow::SetView
« on: June 12, 2008, 06:38:45 pm »
I think the function sf::RenderWindow::SetView needs a better comment including a big, phat warning that the instance of the sf::View you pass as paramater must not be destroyed for the whole lifetime of the render window, because not the values of the passed view are stored but only a pointer to that view.

When I tinkered around the first time with SetView I got a big crash due to access of invalid memory because I used it like this...
Code: [Select]
MyRenderWindow(sf::View(0, 0, 800, 600));
...which was perfectly fine for all the other SFML functions I used so far.