FBO Exception EDIT: FIXED-YAY

Started by
6 comments, last by AverageJoeSSU 16 years, 3 months ago
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]

------------------------------

redwoodpixel.com

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.
Sincerely,Arto RuotsalainenDawn Bringer 3D - Tips & Tricks
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?

------------------------------

redwoodpixel.com

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?

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.




}

------------------------------

redwoodpixel.com

Fixed.... i switched to GLee?? Obviously the way i was using Glew. Anyone use Glew for FBOs?

------------------------------

redwoodpixel.com

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.
makes sense lol.... doh!

somehow looking through all the Docs i missed that little line of code.

------------------------------

redwoodpixel.com

This topic is closed to new replies.

Advertisement