SFML community forums

Help => General => Topic started by: sharethis on March 14, 2013, 05:46:44 pm

Title: Do my framebuffers survive a window recreatation?
Post by: sharethis on March 14, 2013, 05:46:44 pm
I use SFML to handle window and context creation for me. Since I implemented deferred shading, I make use of many framebuffers. When I recreate the window to switch to fullscreen, I get continuous OpenGL errors.

Do my framebuffers still exists after recreating the window? I do not know much about SFML's internal context handling but I know that for example shader programs are still available after window recreation.
Title: Re: Do my framebuffers survive a window recreatation?
Post by: Laurent on March 14, 2013, 05:52:49 pm
Quote
Do my framebuffers still exists after recreating the window
Yes, they should.
Title: Re: Do my framebuffers survive a window recreatation?
Post by: sharethis on March 14, 2013, 07:27:18 pm
Somehow, my calls to "glBindFramebuffer" cause invalid operation errors after the window was recreated. Whether I initially create the window in windowed or fullscreen mode, there are no errors and rendering works. But as I said after recreating the window it stops working.

Quote from: http://www.opengl.org/sdk/docs/man/xhtml/glBindFramebuffer.xml
GL_INVALID_OPERATION is generated if framebuffer is not zero or the name of a framebuffer previously returned from a call to glGenFramebuffers.

This lets me assume that the framebuffers aren't valid after window recreation anymore. What do you think?
Title: Re: Do my framebuffers survive a window recreatation?
Post by: Laurent on March 14, 2013, 08:15:29 pm
You should write a complete and minimal example that reproduces the problem.
Title: Re: Do my framebuffers survive a window recreatation?
Post by: Lynix on March 14, 2013, 10:10:33 pm
Quote
Do my framebuffers still exists after recreating the window
Yes, they should.

http://www.opengl.org/registry/specs/ARB/framebuffer_object.txt
Quote
* ARB FBOs are not shareable.

So I think they get destroyed with the window.
Title: Re: Do my framebuffers survive a window recreatation?
Post by: Laurent on March 15, 2013, 07:57:52 am
Quote
ARB FBOs are not shareable.
Oh... that's strange.

Thanks a lot :)