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

Author Topic: [Code] window resizing  (Read 1514 times)

0 Members and 1 Guest are viewing this topic.

exafi

  • Newbie
  • *
  • Posts: 41
    • View Profile
[Code] window resizing
« 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);
}
//##############################################

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
[Code] window resizing
« Reply #1 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

exafi

  • Newbie
  • *
  • Posts: 41
    • View Profile
[Code] window resizing
« Reply #2 on: March 10, 2012, 01:04:03 pm »
is a contribution xD