SFML community forums

Help => Graphics => Topic started by: exafi on March 10, 2012, 01:11:59 am

Title: [Code] window resizing
Post by: exafi on March 10, 2012, 01:11:59 am
Here I put a code.
I am sorry my english is very bad


Code: [Select]

unsigned int _WIDTH=840;
unsigned int _HEIGHT=640;
sf::View _CAMARA(sf::FloatRect(0, 0, _WIDTH, _HEIGHT));
sf::RenderWindow app(sf::VideoMode(_WIDTH,_HEIGHT,32),"Window RULZ . By xafi");
//##############################################
if(app.GetWidth()!=_WIDTH || app.GetHeight()!=_HEIGHT){
        _WIDTH=app.GetWidth();
        _HEIGHT=app.GetHeight();
        _CAMARA.SetFromRect(sf::FloatRect(0, 0, _WIDTH, _HEIGHT));
        app.SetView(_CAMARA);
}
//##############################################
Title: [Code] window resizing
Post by: Nexus on March 10, 2012, 09:47:28 am
And your problem?

By the way, you shouldn't use identifiers like _WIDTH, as they are reserved for compiler and implementation. Use WIDTH, width or Width.
Title: [Code] window resizing
Post by: exafi on March 10, 2012, 01:04:03 pm
is a contribution xD