Jump to content
  • Advertisement
Sign in to follow this  
spriggan

More than one FBO causes error

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

Hello,

 

When I try to create more than one Frame Buffer Object, I get the GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER error.

 

Here is the code:

 

//-----------------------------------------------------------------------------------------------------

 

// Generate frame buffer index
glGenFramebuffers(1, &m_uFramebufferIndex);
 
// reading and writing to frame buffer
glBindFramebuffer(GL_FRAMEBUFFER, (GLuint)m_uFramebufferIndex);
 
// create texture for rendering
TextureMan_Get()->CreateTexture(puTexId, uXRes, uYRes);
m_uTexId = *puTexId;
 
// attach texture to frame buffer
glFramebufferTexture2D(GL_FRAMEBUFFER, (GLenum)uAttachmentIndex,GL_TEXTURE2D, (GLuint)m_uTexId, 0);
 
if (bDepthBuffer)
{
// The optional depth buffer
glGenRenderbuffers(1, &m_uRenderbufferIndex);
glBindRenderbuffer(GL_RENDERBUFFER, (GLuint)m_uRenderbufferIndex);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, (GLsizei)uXRes, (GLsizei)uYRes);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, (GLuint)m_uRenderbufferIndex);
}
 
// check frame buffer
uint32 uStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER);
 
if(uStatus == GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)
{
assert(0 && "Frame buffer attatchment is incomplete");
}
 
else if(uStatus == GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)
{
assert(0 && "Frame buffer missing attachment");
}
 
else if(uStatus == GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER)
{
assert(0 && "Frame buffer lacks draw buffer");
}
 
else if(uStatus == GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER)
{
assert(0 && "Frame buffer lacks read buffer");
}
 
else if(uStatus == GL_FRAMEBUFFER_UNSUPPORTED)
{
assert(0 && "Frame buffer not supported on this system");
}
 
else if(uStatus == 0)
{
assert(0 && "Frame buffer has unknown error");
}
 
The code exits the function and updates the draw buffers table below
 
// Set the list of draw buffers.
glDrawBuffers(m_nNumRenderTargets, m_uColourAttatchments);
 
// unbind FBO
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
 
//-----------------------------------------------------------------------------------------------------
 
Thanks for any help.

 

 

 

 

 

Share this post


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