Jump to content
  • Advertisement
Sign in to follow this  
alon_gl

glGenRenderbuffersEXT fails on Unhandled exception

This topic is 1976 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

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!

Share this post


Link to post
Share on other sites
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).

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!