glGenRenderbuffersEXT fails on Unhandled exception

Started by
0 comments, last by C0lumbo 11 years, 2 months ago

For an unknown reason, the standard glGenRenderbuffersEXT command fails with an "Unhandled exception" message.

GLuint DepthBuffer;

glGenRenderbuffersEXT(1, &DepthBuffer);

A few more details:

1. I am using a remote machine which does not have a graphics card (it has an ivb i-7 cpu which has embedded GPU).

2. I added the following command which I saw in another track, no success:

glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)wglGetProcAddress("glGenFramebuffersEXT");

3. The full routine:

void ARDriver::MakeFrameBuffer()

{

cout << " ARDriver: Creating FBO... ";

glGenTextures(1, &mnFrameBufferTex);

glBindTexture(GL_TEXTURE_RECTANGLE_ARB,mnFrameBufferTex);

glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0,

GL_RGBA, mirFBSize.x, mirFBSize.y, 0,

GL_RGBA, GL_UNSIGNED_BYTE, NULL);

glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

GLuint DepthBuffer;

glGenRenderbuffersEXT(1, &DepthBuffer); // *** This command fails *** //

glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthBuffer);

glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, mirFBSize.x, mirFBSize.y);

glGenFramebuffersEXT(1, &mnFrameBuffer);

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mnFrameBuffer);

glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,

GL_TEXTURE_RECTANGLE_ARB, mnFrameBufferTex, 0);

glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,

GL_RENDERBUFFER_EXT, DepthBuffer);

CheckFramebufferStatus();

cout << " .. created FBO." << endl;

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

}

Thanks a lot!

Advertisement

Have you created an OpenGL context that is attached to the thread that this function executes on?

e.g. On Mac I have a line like this : tAGLContext = aglCreateContext(tPixelFormat, nil);

I assume there's something equivalent on windows (if that's the platform you're using).

The other thing to do is check for OpenGL errors. In my code I have a wrapper for every OpenGL function call, and if I'm tracking a bug or error that I think might be OpenGL related then I enable a check of glGetError after every single function call (as opposed to checking glGetError once per frame like I do normally).

This topic is closed to new replies.

Advertisement