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

Author Topic: Object lost on window re-creation.  (Read 2346 times)

0 Members and 1 Guest are viewing this topic.

ZoserLock

  • Newbie
  • *
  • Posts: 2
    • View Profile
Object lost on window re-creation.
« on: December 11, 2012, 12:01:38 pm »
Hi i have a little question,

When i change the resolution of the game the window is recreated and sfml somehow saves the objects from the previus contex( objects like textures, vbo)  but the frame buffer objects are not saved.

i need to know if that is the espected behavior.

Thx

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Object lost on window re-creation.
« Reply #1 on: December 11, 2012, 01:20:08 pm »
Nothing is supposed to be lost. Are you sure that they are really lost, it's not just a state that you forgot to reset?
Laurent Gomila - SFML developer

ZoserLock

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Object lost on window re-creation.
« Reply #2 on: December 12, 2012, 02:34:09 am »
Hi again,

first of all, thanks for the answer.

i checked the state and they are OK.

i checked the opengl Errors and gives "invalid operation" on glBindFramebuffer(GL_FRAMEBUFFER, mFrameBufferId);. It seems that the FBO ID becomes invalid after the change of the video mode.

also, i checked GDebugger and indeed... the FBOs of previous context still there.

so i don't have any more clues.

i dont know if you have another ideas.  :(

note: im using SFML 2.0 only for the OpenGL window creation.





eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Object lost on window re-creation.
« Reply #3 on: December 12, 2012, 02:47:07 am »
Although you say the states are OK, do you call window.resetGLStates()?
If you run some of your own OpenGL code you (sometimes) need to do that. ;)

Then again I don't really know anything about OpenGL...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything