Windowed fine, full screen problems

BlitzMax Forums/BlitzMax Beginners Area/Windowed fine, full screen problems

DannyD(Posted 2006) [#1]
Hi,
When I run the following in full screen code the images are displayed incorrectly
Graphics 1024,768,32

maxd# = 30.0
For x = 0 To 63
	For y = 0 To 63
		d# = Sqr((x-32.0)*(x-32.0) + (y-32.0)*(y-32.0))/maxd
		d = d*0.5 + 0.5
		If d>1.0 Then d = 1.0
		SetColor d*255,d*255,d*255
		Plot x,y
	Next
Next
Flip

Global img:TImage = CreateImage(64,64)
GrabImage(img,0,0)
SetImageHandle img,32,32

Type lax
	Global list:TList = New TList
	
	Field x#,y#
	Field dx#,dy#
	
	Method New()
		List.AddLast Self
		x = Rnd(1024)
		y = Rnd(768)
		dx = Rnd(-5,5)
		dy = Rnd(-5,5)
	End Method
	
	Function Update()
		
		SetBlend SHADEBLEND
		
		For l:lax = EachIn lax.list
			l.x = l.x + l.dx
			l.y = l.y + l.dy
			If l.x<32 And l.dx<0
				l.x = 32
				l.dx = -l.dx
			ElseIf l.x>GraphicsWidth()-32 And l.dx>0
				l.x = GraphicsWidth()-32
				l.dx = -l.dx
			EndIf

			If l.y>GraphicsHeight()-32 And l.dy>0
				l.y = GraphicsHeight()-32
				l.dy = -l.dy
				If l.dy>-1 Then l.dy = -20.0
			EndIf
			
			l.dy = l.dy + 0.4

			DrawImage img,l.x,l.y
		Next
		
	EndFunction
	
End Type

For i = 0 To 20
	New lax
Next

SetClsColor 255,255,255

Repeat
	Cls
	lax.Update()
	Flip 
Until KeyHit(KEY_ESCAPE)



If I modify the
Graphics 1024,768
to run it in a windows it works just fine. Any idea?


skidracer(Posted 2006) [#2]
Full screen is double buffered so I don't think you should call flip before GrabImage, the example in the docs doesn't.


DannyD(Posted 2006) [#3]
Well spotted, thanks.