glGenRenderbuffersEXT() segfault? Need help...

Anyone have a clue why glGenRenderbuffersEXT() would segfault? I’m using Qt QGLWidget.

ScreenItem::ScreenItem(int img) : Manager()
{
   mTexImg = img;

   glEnable(GL_TEXTURE_2D);


   // create a texture object
   glGenTextures(1, &mTexBack);
   glBindTexture(GL_TEXTURE_2D, mTexBack);
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
   glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
   glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); // automatic mipmap
   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, SysInfo::width(), SysInfo::height(), 0,
                GL_RGBA, GL_UNSIGNED_BYTE, 0);
   glBindTexture(GL_TEXTURE_2D, 0);
printf("P %d
", &mDepth);
   // create a renderbuffer object to store depth info
   glGenRenderbuffersEXT(1, &mDepth);
printf("dP
");
   glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mDepth);
printf("ddP
");
   glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
                                SysInfo::width(), SysInfo::height());
printf("dP
");
   glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
printf("P
");
   // create a framebuffer object
   glGenFramebuffersEXT(1, &mFBO);
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFBO);
printf("P
");
   // attach the texture to FBO color attachment point
   glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
                                GL_TEXTURE_2D, mTexBack, 0);
printf("P
");
   // attach the renderbuffer to depth attachment point
   glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
                                GL_RENDERBUFFER_EXT, mDepth);
printf("P
");
}

output:

f
gggggga
adddddd
P 144564912
Segmentation fault

Did you load the glGenRenderbuffersEXT function pointer?

So… if I understand that correctly I have to call that function with “glGenRenderbuffersEXT()” as the argument and then typedef what it returns as glGenRenderbuffersEXT()?

Also… is this available for the iphone too and if so is it the same method as the mac?

Didn’t work: obj/ScreenItem.cc:10: error: ‘glXGetProcAddress’ was not declared in this scope

What do I need to include? I already have GLEW GLEXT included…

obj/ScreenItem.cc:10: error: ‘glXGetProcAddress’ was not declared in this scope

Did you include glx.h?