Get Framebuffer Object Handle for window [SDL2 iOS]

I’ve been learning OpenGL ES 2.0 on iOS for a few months now, however this is the first time I’ve used a framework around it. On desktop OpenGL, for the systems I have used at least, the frame buffer object handle for the main window is 0, so you would call glBindFramebuffer(GL_FRAMEBUFFER, 0) if you wanted to do something to the screen. On iOS at least (dunno about android), a frame buffer object is created as if it were an offscreen rendering target, and then you call a function to push a color render buffer to the screen. How do I get a handle to this frame buffer object with the standard SDL2 api? I know I could just bind the window and check the frame buffer binding, but that feels a bit to jank of a solution.

Nathaniel

I’m not using iOS right now, but it seems to me that using glGetIntegerv()
with GL_FRAMEBUFFER_BINDING is the right way to do it. Otherwise there
would have to be a dedicated function to retrieve it that is
OpenGL-specific (and which would probably just call glGet…).

Anyway, I get this idea from the fact that SDL’s built-in GLES 2.0 renderer
uses exactly that method in GLES2_CreateRenderer() of SDL_render_gles2.c.
:wink:

Jonny DOn Sat, Jan 25, 2014 at 7:49 PM, Teknoman117 <linux.robotdude at gmail.com>wrote:

I’ve been learning OpenGL ES 2.0 on iOS for a few months now, however
this is the first time I’ve used a framework around it. On desktop OpenGL,
for the systems I have used at least, the frame buffer object handle for
the main window is 0, so you would call glBindFramebuffer(GL_FRAMEBUFFER,
0) if you wanted to do something to the screen. On iOS at least (dunno
about android), a frame buffer object is created as if it were an offscreen
rendering target, and then you call a function to push a color render
buffer to the screen. How do I get a handle to this frame buffer object
with the standard SDL2 api? I know I could just bind the window and check
the frame buffer binding, but that feels a bit to jank of a solution.

Nathaniel


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org