PDA

View Full Version : FBO incomplete ?



divide
11-24-2010, 10:32 AM
Hello,

The following code works on Windows, but not on Mac OS X 10.6.3 (geforce GTX260)
What's wrong ?

glGenFramebuffersEXT(1, &screenfbo);
glGenTextures(1,&screentex);

glBindTexture(GL_TEXTURE_2D, screentex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, width, height, 0, GL_RGBA, GL_FLOAT, 0);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL _CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL _CLAMP_TO_BORDER);
glBindTexture(GL_TEXTURE_2D, 0);

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, screenfbo);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_CO LOR_ATTACHMENT0_EXT,GL_TEXTURE_2D,screentex,0);

glCheckFramebufferStatus(GL_FRAMEBUFFER); //return GL_FRAMEBUFFER_COMPLETE on Win, but GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT on Mac !

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

divide
11-24-2010, 03:28 PM
problem solved, width and height were both to zero for some reason on Mac ...