Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / General Programming / viewport blinking??? Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Vast

February 06, 2005, 06:01 PM

Hey everyone, im using nehe's tutorial for multiple viewports, i get everything running in SDL, but for some reason, whenever i run it, the stuff i render starts blinking. Now, i tried taking glClear (GL_COLOR_BUFFER_BIT); out, and it worked, but it left some artifacts, like the item doubles in some way related to the size of the screen (didnt bother figuring out the pattern).

Anyway, i looked at the linux port for it (SDL) and i seemed to be doing everything the same way (i didnt compile the port yet, to test).

But can anyone suggest what could be wrong, or what could be a source for such behavoir?

Tim

 
Reedbeta

February 06, 2005, 06:54 PM

That sounds like double buffering is not working properly. Are you sure you're rendering to the back buffer?

 
Vast

February 07, 2005, 01:49 PM

*messege deleted*

I think i fixed it. The way i did it, is i cleared the color buffer BEFORE i cleared the depth buffer. That way it stoped blinking.

EDIT:::::
Also, it clears the color buffer BEFORE i set the GL_MODELVIEW matrix mode. Which is bad?
/ENDEDIT:::::

Otherwise it just blinks the hell out of itself ;)

Anyway. Can someone approve on this move? Just to be sure that nothing goes *boom* in a middle of development...

Thanks.


Tim

 
Vast

February 07, 2005, 02:47 PM

Nope, now the ortho viewports won't draw :(

 
Victor Widell

February 07, 2005, 07:13 PM

"i cleared the color buffer BEFORE i cleared the depth buffer."

It should not matter in wich order you clear the buffers. In fact, you usually clear all buffers at the same time.


"it clears the color buffer BEFORE i set the GL_MODELVIEW matrix mode"

I dont _think_ it matters. Though, you usually set the modelview matrix just before you start drawing.


As Reedbeta said, it sounds like a double buffer problem. Could you post the code of your window initialization?

 
This thread contains 5 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.