buffering ahead bug with source code

BlitzMax Forums/BlitzMax Programming/buffering ahead bug with source code

Robert Cummings(Posted 2006) [#1]
'low poly and high fill rate causes the issue, solvable by flushing the driver's
'buffered frames using grab pixmap or locking a buffer with a large speed penalty.
'opengl is unaffected.

'change how many loops you do till you see the lag and not general slowdown
'this will vary from pc to pc

'SetGraphicsDriver GLMax2DDriver()
Graphics 800,600,0,0

AutoMidHandle True
image:TImage = LoadImage("arrow.png") 'any 32x32 image

While Not KeyHit(KEY_ESCAPE)
	Cls
	mx = MouseX()
	my = MouseY()	
	
	SetScale 8,8
	For i = 0 To 2000
		DrawImage image,mx,my
	Next
	Flip 0
	
	'insert workarounds here
	
Wend
End


Please adjust iterations till its not slow on your pc but illustrates clearly almost a second of lag. Ideal conditions are low poly and high fillrate.

GrabPixmap(0,0,2,2) solves issue but causes negative slowdown.


Robert Cummings(Posted 2006) [#2]
(don't forget to change the for loop to a number which doesn't actually slow your pc to a crawl).


skidracer(Posted 2006) [#3]
Please don't post multiple bug reports regarding the same issue. will reply elsewhere..


Robert Cummings(Posted 2006) [#4]
Okay thanks skid.

New stuff has come to light (works on my pc in any rate):

    If TD3D7Max2DDriver(_max2dDriver)
      While DDERR_WASSTILLDRAWING = PrimaryDevice.PrimarySurface.GetBltStatus(DDGBS_ISBLTDONE) ; Wend
    EndIf



Difference(Posted 2006) [#5]
[EDIT] Works for me! ( http://www.blitzbasic.com/Community/posts.php?topic=58192 )

Now, lets get BLR to implement this as a function in B3D too!!!