Sign in to follow this  

FBO Exception EDIT: FIXED-YAY

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

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]

Share this post


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


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


So it just might be that you are calling 'nothing' which is causing the problem.

Share this post


Link to post
Share on other sites
Then what is the problem?


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.




}

Share this post


Link to post
Share on other sites
Quote:
Original post by AverageJoeSSU
Fixed.... i switched to GLee?? Obviously the way i was using Glew. Anyone use Glew for FBOs?
Did 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.

Share this post


Link to post
Share on other sites

This topic is 3627 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this