PDA

View Full Version : Framebuffer object issues



Vilem Otte
06-11-2011, 02:09 PM
Hello,

I've encountered some serious issues with framebuffer objects (GL_ARB_framebuffer_object).

This is what I do:

glGenRenderbuffers( 1, &rbo );
glBindRenderbuffer( GL_RENDERBUFFER, rbo );
glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT, window_t->window_width, window_t->window_height );
glBindRenderbuffer( GL_RENDERBUFFER, 0 );

glGenFramebuffers( 1, &fbo );
glBindFramebuffer( GL_FRAMEBUFFER, fbo );
int e = glGetError(); printf("%d\n", e);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, dynamic_tex, 0);
glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rbo );
GLenum status = glCheckFramebufferStatus( GL_FRAMEBUFFER );
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
I get GL_INVALID_ENUM on glBindFramebuffer call. I'm starting to be desparate (Porting engine to linux can be really pain). As for my gfx hardware - Mobility Radeon 5470, Catalyst 11.4;

OS Kubuntu linux 10.04

Alfonse Reinheart
06-11-2011, 02:48 PM
I get GL_INVALID_ENUM on glBindFramebuffer call.

Are you sure you're not getting an error from a previous function? Do you clear errors before calling this function?

Vilem Otte
06-11-2011, 03:01 PM
Yep, sure it's not from previous function. Clearing them with:

while (glGetError() != GL_NO_ERROR);

I added it after I post here, thought I actually missed it and issue is somewhere else ... well now I know that it actually isn't.

Vilem Otte
06-11-2011, 03:15 PM
Problem solved...

Thanks to my friend on another forum. Anyway it was in extension grabbing (you know that glXGetProcAddress or under Win wglGetProcAddress), I use my own library on it and during my port of it I somehow changed some values. And so glBindFramebuffer wasn't addressing glBindFramebuffer internally... Nah. I hate myself sometimes.

Finally good thing after whole day of hard work.

Anyway thanks for response.