PDA

View Full Version : Re-sizing problem



Gelldur
07-06-2011, 03:32 AM
Hello when i re-size my GLUT window it blinks its very annoying. I have Ubuntu and installed fresh ATI drivers with Open GL 4.1. Also on start if I just move window my triangle disappear.
PICTURE:
1. On start it looks: http://dl.dropbox.com/u/15084870/Screenshot-3.png

2. When i move it: http://dl.dropbox.com/u/15084870/Screenshot-4.png

3. When i'm re-sizing (you can see thie pice shows what's under the GLUT window and it blinks): http://dl.dropbox.com/u/15084870/Screenshot-5.png

Thanks a lot.

PS. Transparency on Linux doesn't work? I try to set alpha to Triangle but it doesn't work the same in Qt.

mobeen
07-06-2011, 03:34 AM
Could u show us ur resize/relevant code please? We donot have magic eyes that could extract the code from the image :P

Gelldur
07-06-2011, 03:41 AM
Oh sorry here is the Code : http://dl.dropbox.com/u/15084870/Triangle.cpp

It's a Triangle sample form CodeBible OpenGl

mobeen
07-06-2011, 03:53 AM
Hi,
For the main problem, could u try adding glFinish() after glutSwapBuffers call and see if this helps. For transparency to work, you need to enable blending


glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Gelldur
07-06-2011, 04:47 AM
Ok when i add glFinish it doesn't change anything the same. And Alpha works thanks :)

mobeen
07-06-2011, 04:54 AM
Could u put glFinish before glutSwapBuffers call and see if it helps.

Gelldur
07-06-2011, 04:55 AM
The Same

mobeen
07-06-2011, 05:06 AM
The code that u have given works fine on my machine.

Gelldur
07-06-2011, 05:14 AM
You run this on Linux? Maybe something is bad configured i will try if anyone has this problem and solve it please write :)

Thanks a lot!

mobeen
07-06-2011, 05:34 AM
nope I am on windows 7, one thing you can do is add this line at the start of the render function and see if it gives an assertion.


//include <cassert> at the top ofcourse
assert(glGetError() == GL_NO_ERROR);

Gelldur
07-06-2011, 05:42 AM
XD it blocks my computer i cant move even window :D

mobeen
07-06-2011, 05:47 AM
DO u get any assertion? check the console output.

_arts_
07-06-2011, 06:42 AM
You might have a driver bug.
Also your resize function should have projection and modelview initialization.
Your render function might also lack some view statement.

Gelldur
07-07-2011, 02:29 AM
OK thanks guys i think is's a bug in driver.