Posted: Sun Jan 12, 2003 9:31 pm
Restored from previous forum. Originally posted by iRoNiC.
I want to make a 50FPS FullScreen scrolling with a SpriteScreen.
But, the scrolling is very bad, i don't know why !!
I use the GetTickCount_() to check the time and to wait 20ms between two FlipBuffers()
But, i dont know why, it's so bad !!
;*****************************************
vitesse=8
InitSprite()
InitKeyboard()
OpenScreen(640,480,16,"Scroll")
CreateSprite(10,640+2*vitesse,480)
SetRefreshRate(85) ; ==> 85Hz Screen, if monitor can !!
limit = 1000/50 ; ==> Set to 50 FPS (20ms)
Repeat
timer = GetTickCount_() ; take time
ExamineKeyboard()
ClearScreen(0,0,0)
StartDrawing(SpriteOutput(10))
Plot (639+vitesse,Random(479),RGB(255,255,255))
StopDrawing()
UseBuffer(10)
ClipSprite(10,vitesse,0,640+vitesse,480)
DisplaySprite (10,0,0)
UseBuffer(-1)
DisplaySprite (10,0,0)
; wait 20ms
Repeat:Until GetTickCount_()>=timer+limit
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
;*****************************************
iRoNiC
Basic Coder
I want to make a 50FPS FullScreen scrolling with a SpriteScreen.
But, the scrolling is very bad, i don't know why !!
I use the GetTickCount_() to check the time and to wait 20ms between two FlipBuffers()
But, i dont know why, it's so bad !!
;*****************************************
vitesse=8
InitSprite()
InitKeyboard()
OpenScreen(640,480,16,"Scroll")
CreateSprite(10,640+2*vitesse,480)
SetRefreshRate(85) ; ==> 85Hz Screen, if monitor can !!
limit = 1000/50 ; ==> Set to 50 FPS (20ms)
Repeat
timer = GetTickCount_() ; take time
ExamineKeyboard()
ClearScreen(0,0,0)
StartDrawing(SpriteOutput(10))
Plot (639+vitesse,Random(479),RGB(255,255,255))
StopDrawing()
UseBuffer(10)
ClipSprite(10,vitesse,0,640+vitesse,480)
DisplaySprite (10,0,0)
UseBuffer(-1)
DisplaySprite (10,0,0)
; wait 20ms
Repeat:Until GetTickCount_()>=timer+limit
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
;*****************************************
iRoNiC
Basic Coder