50FPS scrolling with 85Hz Screen Monitor

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

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
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Kale.

works fine for me :)

--Kale

Getting used to PureBasic and falling in Love! :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Why not using SetFrameRate(50) ?

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by iRoNiC.

There's a probleme for me, and on some other computers.

I can use SetFrameRate(50) but i would like to know why the stars are *2 or *3 on the screen and why the scrolling is so bad !

I made this on other basic and work fine, not here !

Anyone can tell me why ?

iRoNiC (French Coder)



Basic Coder
Post Reply