FBO Exception EDIT: FIXED-YAY
As you can tell with the past couple posts... i am trying to implement an FBO with MRTs ... i'm using Cg as the Shader Language.
can someone explain why i would get an exception when doing the following...
this->DiffuseColor3 = 0; //GLuint
glGenFramebuffersEXT(1, &DiffuseColor3);
where in my code would i call this... in the "InitGL" part right? is there anything i need to enable?
[Edited by - AverageJoeSSU on January 9, 2008 1:52:46 PM]
First check the spec for using FBO's.
There is also another thing, you are using extension function and GL spec doesn't require these extension functions to be exported from the library, so you need to do :
So it just might be that you are calling 'nothing' which is causing the problem.
There is also another thing, you are using extension function and GL spec doesn't require these extension functions to be exported from the library, so you need to do :
PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) wglGetProcAddress( "glGenFramebuffersEXT" );
So it just might be that you are calling 'nothing' which is causing the problem.
yeah i have seen that before... i forgot to say that i am using Glew... and i thought it took care of that for me?
Quote:Original post by AverageJoeSSU
yeah i have seen that before... i forgot to say that i am using Glew... and i thought it took care of that for me?
Yes, it will:
GLEW Extensions
Then what is the problem?
this throws an exception when i initialize the class.
}
class DeferredShading { public: DeferredShading(); ~DeferredShading(); GLuint Position1; GLuint Normal2; GLuint DiffuseColor3; GLuint depthbuffer3;//int width, height; private:};
#include"Lighting.h"DeferredShading::DeferredShading(){ //this->Position1 = 100; this->DiffuseColor3 = 0; //this->Normal2 = 102; //glGenFramebuffersEXT(1, &Position); //glGenFramebuffersEXT(1, &Normal); glGenFramebuffersEXT(1, &DiffuseColor3); //THROWS EXCEPTION //glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, Position); //glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, Normal); //glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, DiffuseColor3); //glGenRenderbuffersEXT(1, &depthbuffer3); //glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthbuffer3); //glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height);
this throws an exception when i initialize the class.
}
Quote:Original post by AverageJoeSSUDid you call glewInit()? GLee uses lazy loading in the more recent versions, which basically means the first time you use one of the extension functions it calls GLeeInit() for you so you don't need to manually call it. As far as I know you still need to manually initialize GLEW, not that it's very difficult.
Fixed.... i switched to GLee?? Obviously the way i was using Glew. Anyone use Glew for FBOs?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement