Skip to main content
GameDev.net gamedev.net
🔒 Locked

invalid framebuffer operation

Started by yifli82 Aug 21, 2011 at 6:17 PM 9 replies 14.1k views
Original Post
yifli82
yifli82
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
karwosts
karwosts
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
yifli82
yifli82

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


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

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
V-man
V-man
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.
pancakinator
pancakinator
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).

yifli82
yifli82

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.

yifli82
yifli82

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

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


yifli82
yifli82

[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]



I checked framebuffer status in a working opengl application (running under Lion), no error is returned.

That application was written under Snow Leopard and built using CMake+Xcode 3.1. Now I'm using Xcode 4.1

Both the working application and my test program are Qt based.



Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.