Jump to content
  • Advertisement
Sign in to follow this  
RonD

glGenFramebuffersEXT

This topic is 3496 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, This is the first time i look into framebuffers, but even the first command goes terribly wrong. consider the following program:
#include <iostream>
#include <GL/glew.h>
#include "glut.h"
GLuint fbo;
int main(int argc, char* argv)
{
	/*
	glutInit(&argc, &argv);
	glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
	glutInitWindowSize (500, 500);
	glutCreateWindow ("window title");
	*/

	if (glewGetExtension("GL_EXT_framebuffer_object") == GL_TRUE){
		std::cout << "FBO supported" << std::endl;
		getchar();
		glGenFramebuffersEXT(1,&fbo);
	} 
	else{
		std::cout << "FBO not supported" << std::endl;
		getchar();
	}
    return EXIT_SUCCESS;
}

what happens: - as it is, it outputs FBO not supported. - If I uncomment the lines for initialising the glut window, it will output "FBO supported", but then as i press a key, I get an access violation exception for the glGenFramebuffersEXT function. Could someone please explain to me, what exactly is going on there? I do not get why initialising a glut window affects the framebuffer and neither do i get, why it crashes even though it is supported. btw: I use a geforce8800gts512 Thanks for any help, RonD

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by RonD
- If I uncomment the lines for initialising the glut window, it will output "FBO supported


It is normal that you get this error if no OpenGL context has been created. If I'm not mistaking, you could create such a context using different graphics card available on your computer, and not all of them may support FBOs. Because of this, you can't know if FBOs (or any other extension) is available without having created an OpenGL context (which glut does, most likely in glutCreateWindow).

Quote:
Original post by RonD
[...] but then as i press a key, I get an access violation exception for the glGenFramebuffersEXT function.


In order to diagnose this, we'll need to know how you queried the entry point for the glGenFramebuffersEXT function. You're most likely calling a NULL or undetermined function pointer. Check if your function pointer is NULL before calling it and tell us how your got that function pointer in the first place (wglGetProcAddress? GLEW?).

EDIT: I see you're using GLEW, I haven't used it but don't forget to call glewInit() as seen here.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!