clear screen problems.
HI all,
I am facing quite an unusal problem. I have a small code to clear the screen in a given color . After the screen is cleared either test messages are displayed or some other rendering function is done.
However the clear screen function fails randomly. ie it clears the screen some time and does not clear some other time.
COuld any one tell me why or how this is happening.
I just draw a QUAD of full screen size ... i even tried the normal clear screen but it appeared to be much slower.
Any help will be greately appreciated.
Here is the code:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_QUADS);
switch(color)
{
case WHITE:glColor3f(1.0,1.0,1.0);
break;
case BLACK:glColor3f(0.0,0.0,0.0);
break;
case GREEN:glColor3f(0.0,0.7,0.1);
break;
case BLUE:glColor3f(0.2,0.2,1.0);
break;
case RED:glColor3f(0.7,0.0,0.1);
break;
case YELLOW:glColor3f(0.9,1.0,0.0);
break;
default:glColor3i(255,255,255);
}
glVertex3f(-1.0,1.0,1.0);
glVertex3f(1.0,1.0,1.0);
glVertex3f(1.0,-1.0,1.0);
glVertex3f(-1.0,-1.0,1.0);
glEnd();
if(doublebuffer)
glXSwapBuffers(display,xcanvas);
else
glFlush();
Tell me More
I don''t see why that should happen, plus how exactly are you determining that this is in fact the case?
If you want to clear the screen to a particular colour you can use
glClearColour(r,g,b)
So your glClear() call will clear the screen to that colour.
If glClear is seriously failing, I would suggest looking into getting newer drivers or perhaps the glX functions are failing (quite what you''d do about that I''m not sure).
If you want to clear the screen to a particular colour you can use
glClearColour(r,g,b)
So your glClear() call will clear the screen to that colour.
If glClear is seriously failing, I would suggest looking into getting newer drivers or perhaps the glX functions are failing (quite what you''d do about that I''m not sure).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement