Sign in to follow this  
adawg1414

OpenGL FBO problems

Recommended Posts

I'm not really sure if my video card supports frame buffer objects but I thought most cards starting adding support years ago. I've included glew.h (which has #define GL_FRAMEBUFFER_EXT 0x8D40 in it), I then created an OpenGL program and used the isExtensionSupported function from OpenGL.org and sent the function the parameter value "GL_FRAMEBUFFER_EXT". It returned false. So I'm using a laptop ATI Mobility Radeon X300, did I do that right and what's the easiest way to find this out?

Share this post


Link to post
Share on other sites
I have no idea of how glew works, however if you just want to know really quickly. Then just type something like this:

printf("%s", glGetString(GL_EXTENSIONS));

And look through the printed string and see if it's there.

Share this post


Link to post
Share on other sites
The extension name string is GL_EXT_framebuffer_object, not GL_FRAMEBUFFER_EXT which is just a constant that represents an FBO target. Also, if you're using GLEW, you might as well use GLEW's built-in extension support querying mechanism (whatever that is, I bet it's explained on the GLEW website).

Share this post


Link to post
Share on other sites
Thanks a lot guys, it turns out I was using the wrong thing to check for like Kalidor said.

So now here's the original problem. This code crashes and says "Access violation reading 0x00000000", WHY?

I'm using glew.h, gl.h, glu.h, and glut.h.


int test = isExtensionSupported("GL_EXT_framebuffer_object");
if(test)
{
// generate frame buffers, render buffers
/* it crashes here */ glGenFramebuffersEXT(1, &fbos);
glGenRenderbuffersEXT(1, &rbos);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbos);
}


Share this post


Link to post
Share on other sites
Quote:
Original post by Lord Faron
Probably glGenFramebuffersEXT is not a valid pointer.


What does that mean? Isn't glGenFrameBufferEXT a function call to generate buffers for frame buffer objects?

The only other time I've seen this type of error was when I was trying to run shaders without the correct graphics card drivers. So I'm almost positive this graphics card driver supports frame buffer objects but trying to get a straight answer from ATI is like pulling teeth.

Share this post


Link to post
Share on other sites
Wow, thanks Kalidor that's just what I needed. So now I did
glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)wglGetProcAddress("glGenFramebuffersEXT");
glGenFramebuffersEXT(1, &fbos);


and it works swimmingly :)

**edited - I'm dumber than I thought on this one but at least I learned another way of doing things. It turns out that I just forgot to initialize glew with glewInit(). So there's no need for the code above :p

[Edited by - adawg1414 on October 3, 2006 1:58:32 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this