my background is FLASHING, how to fix this?

BlitzPlus Forums/BlitzPlus Programming/my background is FLASHING, how to fix this?

matthews_30(Posted 2005) [#1]
i think the CLS command is bothering. this is my code (can somebody tell me whats wrong?):

MINAVE = LoadImage("1942.bmp")
background2=LoadImage("1942_2.png")
While cont = 1
Cls
DrawImage background2,0,0
DrawImage MINAVE,jugador1\x, jugador1\y; NUEVO
HUD()
Teclas()
Wend

thanks.


ozak(Posted 2005) [#2]
Maybe af Flip() at the end to syncronize the screen update?
Also, if you can't see the screen for the background, you could skip the cls for a petty speed increase :)


Grey Alien(Posted 2005) [#3]
What's in HUD and Teclas?


anawiki(Posted 2005) [#4]
And you probably can get rid of CLS and instead of DrawImage background2,0,0 use

DrawBlock background2,0,0 (this command doesnt care for transparency, so make sure you dont use one).


AJirenius(Posted 2005) [#5]
Maybe you dont use Backbuffers at all and may consider using that. Check commands like Setbuffer and Flip. They are necessary to make flickerfree graphics.