debug error

Blitz3D Forums/Blitz3D Bug Reports/debug error

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

In the main loop you repeatedly do:

Draw to back buffer
Flip
Grab from back buffer

This has unpredictable results. You can't be sure what the back buffer holds after a flip.

So your main loop should do:

Draw to back buffer
Grab from back buffer
Flip

Here's an example.

Graphics 640, 480
SetBuffer BackBuffer()

Shift = CreateImage (640,55)
Image = CreateImage (64,55)

Rect 0,0,64,55,False
Rect 1,1,62,53,False
GrabImage Image,0,0

Repeat

	Cls
	
	DrawImage Shift,0,20
	DrawImage Image,640 - Count,20
	GrabImage Shift,3,20
	Flip True
	
	Count = Count + 3
	If Count > 65 Then Count = 3

Until KeyDown(1)