SFML community forums

Help => Window => Topic started by: ZoserLock on December 11, 2012, 12:01:38 pm

Title: Object lost on window re-creation.
Post by: ZoserLock 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
Title: Re: Object lost on window re-creation.
Post by: Laurent 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?
Title: Re: Object lost on window re-creation.
Post by: ZoserLock 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.




Title: Re: Object lost on window re-creation.
Post by: eXpl0it3r 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...