refresh canvas problem

BlitzMax Forums/BlitzMax GUI Programming/refresh canvas problem

Hi !
Could you help me with this code. The canvas grid is not displayed correctly (refresh pb with the pixmap ?). where is my mistake. (Should be easy to find...). Thanks

Strict


Global Win2:TGadget   = CreateWindow("Sélection de map...",(GadgetWidth(Desktop())-540)/2,(GadgetHeight(Desktop())-650)/2,540,650,Null,WINDOW_MENU|WINDOW_TITLEBAR|WINDOW_HIDDEN)
Global Panel_choix_map : Tgadget = CreatePanel (0,0,700,40, Win2)
Global Canvas2:TGadget= CreateCanvas(10,50,512,512,Win2) ' + 30 en y
Global tiles : TPixmap = CreatePixmap (512 , 512 , PF_BGRA8888)

	
' -------------------------------------------------------------------------------------------

Function Afficher_grille()

	Local x
	Local y
	Local r
		
	SetColor 50,50,50
	For x=0 To 512 Step 32
		DrawLine x, 0, x, 512
		
	Next
	
	r = 0
	For y=0 To 512 - 32 Step 32
		DrawLine 0, y, 512, y
		DrawText String (r), 10, y + 8
		r = r + 1
	Next

End Function

' -------------------------------------------------------------------------------------------

Function Fenetre_choix_tile()

	ShowGadget Win2
	
	Global Timer:TTimer = CreateTimer(60)
	
	While WaitEvent()
	
		
		Select EventID()
		
			Case EVENT_TIMERTICK
				SetGraphics CanvasGraphics(Canvas2)
				Cls
				SetColor 255,255,255
				
				DrawPixmap tiles, 0,0
				
				Afficher_grille()
				
				
				Flip
			
				
			Case EVENT_WINDOWCLOSE
				Exit
				
		
		End Select
	Wend
	

	HideGadget Win2

End Function

Fenetre_choix_tile()


The canvas grid is not displayed correctly (refresh pb with the pixmap ?).

The canvas grid *IS* displayed but I have no idea what you're expecting to see.

The canvas grid *IS* displayed

it's ok.

should be a driver issue or my card. Now it works fine. sometimes i've this bug...



i don't know why and how to reproduce it.

please test if you have an nvidia card, 6series or highter.

If someone experimented the same issue, could he post here ! Many thanks

I wonder if Flip True would help? Just guessing.

David