L'affichage ci dessous clignote :
Code : Tout sélectionner
DrawImage(ImageID(0),0,0)
DisplaySprite (p(i,u),i*49+dkx,u*49+dky)
Code : Tout sélectionner
DrawImage(ImageID(0),0,0)
DisplaySprite (p(i,u),i*49+dkx,u*49+dky)
Code : Tout sélectionner
; SPH(2008)
; PB4.2
InitSprite()
InitMouse()
InitKeyboard()
InitSprite3D()
UseJPEGImageDecoder()
;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS )
If OpenScreen(1024,768,32,"") =0
MessageRequester("Erreur", "Impossible d'ouvrir le jeu en 1024*768*32") : End
EndIf
StartDrawing(ScreenOutput())
; creation de sprites clairs
For i=1 To 1000
Box(Random(600),Random(600),Random(300),2+Random(3),RGB(100+Random(155),100+Random(155),100+Random(155)))
Box(Random(600),Random(600),2+Random(3),Random(300),RGB(100+Random(155),100+Random(155),100+Random(155)))
Next
StopDrawing()
GrabSprite(1,0,0,32,32)
GrabSprite(2,32,0,64,32)
GrabSprite(3,0,32,32,64)
GrabSprite(4,32,32,64,64)
FlipBuffers(1)
ClearScreen(0)
CreateImage(0, 1024, 768)
StartDrawing(ImageOutput(0))
;StartDrawing(ScreenOutput())
; creation d'une image de fond foncée
For i=1 To 1000
Box(Random(1020),Random(764),Random(300),2+Random(6),RGB(Random(55),Random(155),Random(155)))
Box(Random(1020),Random(764),2+Random(6),Random(300),RGB(Random(55),Random(155),Random(155)))
Next
StopDrawing()
;
;
;
;
Repeat ; affichage
StartDrawing(ScreenOutput())
DrawImage(ImageID(0),0,0)
StopDrawing()
z=1
For u=0 To 16
For i=0 To 12
DisplaySprite(z,100+i*33,100+u*33)
z+1
If z=5
z=1
EndIf
Next
Next
FlipBuffers()
Delay(1)
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All)
parle en sur le Forum anglais a FredSPH a écrit :En effet, ca fonctionneCpl.Bator a écrit :rajoute ClearScreen(0) après ton repeat et ton histoire est reglée.
Mais l'image pleine ecran recouvre de toute facon tout l'ecran. Alors l'image devrait remplacer un cls !!
C dingue quand meme : pb4 ne plantait pas, et a partir de 4.10, ca plante !!
Non merci. Je n'irais pas au fofo anglais; c'est fred qui viendra a moi (au fofo fr)Dobro a écrit :parle en sur le Forum anglais a FredSPH a écrit :En effet, ca fonctionneCpl.Bator a écrit :rajoute ClearScreen(0) après ton repeat et ton histoire est reglée.
Mais l'image pleine ecran recouvre de toute facon tout l'ecran. Alors l'image devrait remplacer un cls !!
C dingue quand meme : pb4 ne plantait pas, et a partir de 4.10, ca plante !!
J'ai tjr imaginé que fred etait francais ! Il l'est pas ? Si il l'est, il doit passer sur ce forum je pense (tiens, je me rapelle l'avoir vu un jour, son nom apparait orange)Dobro a écrit :j'en ai parlé ici :
http://www.purebasic.fr/english/viewtop ... highlight=
on verra bien ce que Fred dit
il ne la désactive pas apparemment puisqu'il metdjes a écrit :On va encore dire que je m'énerve mais c'est vraiment du grand n'importe quoi! Si tu désactives la synchro, c'est normal que tu aies un clignotement!!! Faudrait réviser le principe du double-buffer et de l'affichage avant d'accuser à tort et à travers.
Code : Tout sélectionner
FlipBuffers()