Sign in to follow this  
yifli82

invalid framebuffer operation

Recommended Posts

[quote name='karwosts' timestamp='1313952935' post='4851979']
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?
[/quote]


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

[/code]

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

[code]GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER);[/code]

Share this post


Link to post
Share on other sites
[quote name='pancakinator' timestamp='1313962996' post='4852021']
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)?

[code]GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER);[/code]
[/quote]

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
[quote name='pancakinator' timestamp='1314032888' post='4852394']
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).


[/quote]


The status returned GL_FRAMEBUFFER_UNDEFINED.

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.
[/quote]

Thanks. I'll try what you suggested.

Share this post


Link to post
Share on other sites
[quote name='yifli82' timestamp='1314035206' post='4852412']
[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.
[/quote]

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
[quote name='yifli82' timestamp='1314035206' post='4852412']
[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.
[/quote]

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.



Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this