Jump to content
  • Advertisement
Sign in to follow this  
AverageJoeSSU

FBO Exception EDIT: FIXED-YAY

This topic is 3848 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
Advertisement
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
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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!