Flickering Sprite
Posted: Sat Jun 20, 2015 1:55 pm
Hi,
I've decided to give the latest version of Pure BASIC a go for games.
Loading and displaying the background sprite leads to flickering at first until things settle down - then the flickering stops.
I'm guessing it's something to do with flip, but I've tried all sorts of combinations, with no luck.
Steve
I've decided to give the latest version of Pure BASIC a go for games.
Loading and displaying the background sprite leads to flickering at first until things settle down - then the flickering stops.
I'm guessing it's something to do with flip, but I've tried all sorts of combinations, with no luck.
Code: Select all
UsePNGImageDecoder()
If InitSprite() And InitKeyboard() And OpenScreen( 1920, 1080, 32, "GameGrid", #PB_Screen_WaitSynchronization )
img = LoadSprite( #PB_Any, "Gamegrid.png" )
col_cls.i = RGB( 0, 0, 0 )
If img
Repeat
ClearScreen( col_cls )
StartDrawing( ScreenOutput() )
DisplaySprite( img, 0, 0 )
StopDrawing()
FlipBuffers()
ExamineKeyboard()
Until KeyboardPushed( #PB_Key_Escape )
FreeSprite( img )
EndIf
EndIf