invalid framebuffer operation

Started by
9 comments, last by yifli82 12 years, 8 months ago
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
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?
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game

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);


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);

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
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.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
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).


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.


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 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.


This topic is closed to new replies.

Advertisement