This code "jitters" full-screen / steady in window

Blitz3D Forums/Blitz3D Beginners Area/This code "jitters" full-screen / steady in window

The flickering is due to the back buffer and front buffers having different images upon them. Basically you are drawing some pixels to one buffer, flipping the buffers, then drawing pixels to a different buffer. This creates two images that are not identical and hence appears to 'jitter'. The following code should do what you are trying to achieve without the jitters.

Graphics 1024,768,32,0

SetBuffer BackBuffer()

SeedRnd MilliSecs()

While Not KeyHit(1)

count# = MilliSecs()
.pattern1
Color Rnd(0,255),Rnd(0,255),Rnd(0,255)
Plot Rnd(0,1023),Rnd(0,767)
If MilliSecs()-count# < 1000/60 Then Goto pattern1

CopyRect 0,0,1024,768,0,0,BackBuffer(),FrontBuffer() 

Wend


Ideally this code should just draw straight to the front buffer, but I was just illustrating a point.