Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

glGenRenderbuffersEXT fails on Unhandled exception

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 alon_gl   Members   

101
Like
0Likes
Like

Posted 21 January 2013 - 09:36 AM

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!



#2 C0lumbo   Members   

4362
Like
0Likes
Like

Posted 21 January 2013 - 09:59 AM

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).






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.