Jump to content
  • Advertisement
Sign in to follow this  
yifli82

invalid framebuffer operation

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

glGetError returned "invalid frame buffer operation" after glGenBuffers(1,&vbo). vbo has a valid value of 1 after glGenBuffers

So what could be the problem?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
That makes no sense, I can't understand any reason why that would throw that error. Are you positive that there are no error before glGenBuffers?

Share this post


Link to post
Share on other sites

That makes no sense, I can't understand any reason why that would throw that error. Are you positive that there are no error before glGenBuffers?



I found the error before glGenBuffers which makes me more confused: the error occurred right after glClear(GL_COLOR__BUFFER_BIT|GL_DEPTH_BUFFER_BIT). I've never seen this problem before.

The following is my OpenGL initialization code:

GLenum err = glewInit();

glClearColor(0.8, 0.8, 0.8 1.0);
glClearDepth(1.0);


glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
err = glGetError();
if( err != GL_NO_ERROR)
qDebug("Initialize GL: %s", gluErrorString(err));


glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);

// setup lighting
.....

// create VBO
glGenBuffers(1, &m_coordsVBO);
glGenBuffers(1, &m_normalsVBO);
glGenBuffers(1, &m_indicesVBO);


Share this post


Link to post
Share on other sites
Most likely you have an error in framebuffer creation so when you try to clear the buffer(s) GL throws an error.

Did you check your framebuffer status (ie. if the status is GL_FRAMEBUFFER_COMPLETE)?

GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER);

Share this post


Link to post
Share on other sites

Most likely you have an error in framebuffer creation so when you try to clear the buffer(s) GL throws an error.

Did you check your framebuffer status (ie. if the status is GL_FRAMEBUFFER_COMPLETE)?

GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER);


You are right, the status is not GL_FRAMEBUFFER_COMPLETE.

What could cause this problem?

P.S., My development machine is a MacBook Pro running Mac OS X Lion

Thanks

Share this post


Link to post
Share on other sites
Have you tested it on another machine? Windows perhaps.
If it works on one and it doesn't on the other, there is something wrong with the driver of one of the machines that creates that difference.

Share this post


Link to post
Share on other sites
What does the status return? (ex. GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT....etc)

It could be a mistake in the framebuffer creation code (I don't think an MBP with Lion should have any issues with driver / framebuffers).

Share this post


Link to post
Share on other sites

What does the status return? (ex. GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT....etc)

It could be a mistake in the framebuffer creation code (I don't think an MBP with Lion should have any issues with driver / framebuffers).





The status returned GL_FRAMEBUFFER_UNDEFINED.

Share this post


Link to post
Share on other sites

Have you tested it on another machine? Windows perhaps.
If it works on one and it doesn't on the other, there is something wrong with the driver of one of the machines that creates that difference.


Thanks. I'll try what you suggested.

Share this post


Link to post
Share on other sites

[quote name='V-man' timestamp='1314029473' post='4852364']
Have you tested it on another machine? Windows perhaps.
If it works on one and it doesn't on the other, there is something wrong with the driver of one of the machines that creates that difference.


Thanks. I'll try what you suggested.
[/quote]

glCheckFramebufferStatus does not return any error when I run the test program on the Windows 7 virtual machine on my MBP.


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!