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

Author Topic: SFML2 -> No more PreserveOpenGLStates?  (Read 2725 times)

0 Members and 1 Guest are viewing this topic.

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
SFML2 -> No more PreserveOpenGLStates?
« on: November 26, 2009, 01:43:46 am »
I see that this function dissapeared, whats the way it works now?
1 - It is enabled by default? Or disabled by default? I prefer something that doesn't eat CPU :-)
2 - In the SFML2 code sample called OpenGL, you have
Code: [Select]
       // Activate the window before using OpenGL commands.
        // This is useless here because we have only one window which is
        // always the active one, but don't forget it if you use multiple windows
        window.SetActive();


I noticed that the box is only drawn if you activate the window. If you don't, it wont be displayed, so it isn't useless, it's necessary.

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: SFML2 -> No more PreserveOpenGLStates?
« Reply #1 on: November 26, 2009, 03:45:17 am »
Quote from: "panithadrum"
1 - It is enabled by default? Or disabled by default? I prefer something that doesn't eat CPU :-)

There's no more the need to preserve any states. The new optimized code applies OpenGL states when calling Display(). Before, that took place everytime you called Draw() of a sf::Drawable. You just need to make sure your windows is being activated in order to use raw OpenGL calls.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML2 -> No more PreserveOpenGLStates?
« Reply #2 on: November 26, 2009, 08:33:13 am »
Quote
I noticed that the box is only drawn if you activate the window. If you don't, it wont be displayed, so it isn't useless, it's necessary.

Fixed ;)
Laurent Gomila - SFML developer

 

anything