Publié : mer. 30/avr./2008 23:14
Buffer = Adresse du 1° octet de la mémoire vidéo.
PF = Format du pixel , 4,3,2,ou 1
BufferP = Taille en octet d'une ligne ex : 1024*4 , le 4 est le Pixel Format
AdresseVideo = Buffer + ( x * PF ) + (BufferP/PF) * (y * PF)
PF = Format du pixel , 4,3,2,ou 1
BufferP = Taille en octet d'une ligne ex : 1024*4 , le 4 est le Pixel Format
AdresseVideo = Buffer + ( x * PF ) + (BufferP/PF) * (y * PF)
Code : Tout sélectionner
InitSprite() : InitKeyboard() : InitMouse()
dw=1024
dh=768
dc=32
OpenScreen(dw,dh,dc,"")
Repeat
ClearScreen(0)
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape) : Quit=1 : EndIf
StartDrawing(ScreenOutput())
Buffer = DrawingBuffer()
BufferP = DrawingBufferPitch()
PixelF = DrawingBufferPixelFormat()
Select PixelF
Case #PB_PixelFormat_8Bits : PF=1
Case #PB_PixelFormat_15Bits : PF=2
Case #PB_PixelFormat_16Bits : PF=2
Case #PB_PixelFormat_24Bits_RGB : PF=3
Case #PB_PixelFormat_24Bits_BGR : PF=3
Case #PB_PixelFormat_32Bits_RGB : PF=4
Case #PB_PixelFormat_32Bits_BGR : PF=4
EndSelect
For i = 1 To 30
x=i
y=i
AdresseVideo = Buffer + ( x * PF ) + (BufferP/PF) * (y * PF)
PokeL(AdresseVideo,$FFFFFF)
Next
StopDrawing()
FlipBuffers()
Until quit=1
End