SFML community forums

General => Feature requests => Topic started by: T.T.H. on June 12, 2008, 06:38:45 pm

Title: better comment for sf::RenderWindow::SetView
Post by: T.T.H. 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.