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

Author Topic: Hoow do I set the position/other stuff before creation?  (Read 1340 times)

0 Members and 1 Guest are viewing this topic.

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
Hoow do I set the position/other stuff before creation?
« on: August 30, 2011, 05:53:48 pm »
Basically I currently use

Code: [Select]
Game::isOpenGLSetup = Game::setupOpenGL();
    App.SetFramerateLimit(GlobalSettings::globalSettings.getFrameRateLimit() );
    App.ShowMouseCursor(false);

    sf::VideoMode desktopVM = sf::VideoMode::GetDesktopMode();
    App.SetPosition( (desktopVM.Width/2.0) - (App.GetWidth()/2.0) , (desktopVM.Height/2.0) - (App.GetHeight()/2.0)  );

    smView = sf::Vector2i(800,600 );
    winView = sf::Vector2i(GlobalSettings::globalSettings.getWinWidth() , GlobalSettings::globalSettings.getWinHeight() );

    App.Show(true);


Where App.create... gets called in setupOpenGL() but this means that the window shows and then after moves looking a bit ugly.
But if I set it before create then it doesnt do anything.
Im not sure if calling create resets all the values or something

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Hoow do I set the position/other stuff before creation?
« Reply #1 on: August 30, 2011, 08:56:30 pm »
Yes, setters that modify the window do nothing if the window doesn't exist.

If all you need is to show the window after its creation, it should be possible soon in SFML 2.
Laurent Gomila - SFML developer