Again about jerky mouse

BlitzPlus Forums/BlitzPlus Beginners Area/Again about jerky mouse

Mr. Write Errors Man(Posted 2005) [#1]
Everything is fine if I run the code below as it is. But I get a jerky mouse if I comment out the text line. Why? What is the proper way to solve this problem?

	Win = CreateWindow("Test",100,100,400,400,0)
	Can = CreateCanvas(0,0,400,400, Win)
	SetBuffer(CanvasBuffer(Can))
	
	Repeat
	
		Cls
		
		If KeyDown(1) Then
			End
		EndIf		
		
		Text 0,0, "hi there"

		FlipCanvas(can,True)
		
	Forever

	End



WolRon(Posted 2005) [#2]
Don't use a Repeat-Forever loop without a WaitEvent(num_of_milliseconds_to_wait) command?


Mr. Write Errors Man(Posted 2005) [#3]
Ah, that solved it. Thanks!

Shouldn't FlipCanvas with True wait for vertical blank before continuing and thus result in similar wait?


WolRon(Posted 2005) [#4]
It probably does wait for the vertical blank, but the Blitz app probably continues to execute since it's only a canvas and not a 'fullscreen' buffer.

I could be wrong though. I haven't performed any tests.