Skip to main content
gamedev.net
🔒 Locked

FBO problems

Started by adawg1414 9 replies 2.7k views
Original Post
adawg1414
adawg1414
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?
angry
angry
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.
Kalidor
Kalidor
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).
adawg1414
adawg1414
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);	}
Lord Faron
Lord Faron
Probably glGenFramebuffersEXT is not a valid pointer.
if (time() == $) { $ = 0; }
Lord Faron
Lord Faron
Probably glGenFramebuffersEXT is not a valid pointer.
if (time() == $) { $ = 0; }
Lord Faron
Lord Faron
Probably glGenFramebuffersEXT is not a valid pointer.
if (time() == $) { $ = 0; }
adawg1414
adawg1414
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.
Kalidor
Kalidor
Read the article mentioned in this entry in this forum's FAQ to learn about extensions. Then use an extension loading library such as GLee or the aforementioned GLEW.
adawg1414
adawg1414
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]
Lord Faron
Lord Faron
Sorry for multiple posts. Don't know what happened...
if (time() == $) { $ = 0; }

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.