______________________________________
Hallo,
bekomme nach dem Aufruf von DrawingBuffer() immer eine 7 zurück bei DrawingBufferPixelFormat().
Muss den Wert immer manuell ändern damit es korrekt angezeigt wird
Beispiel : Pixelgewusel
Code: Alles auswählen
#ScreenWidth = 320 ; Feel free to change this to see the pixel filling speed !
#ScreenHeight = 200
x.l
y.l
col.l
i.l
PixelFormat.l
Buffer.l
Pitch.l
If InitSprite() = 0 Or InitKeyboard()=0
MessageRequester("Error","DirectX 7+ is needed.",0)
EndIf
Structure Pixel
Pixel.l
EndStructure
If OpenScreen(#ScreenWidth, #ScreenHeight, 32, "PB Plasma")
Repeat
StartDrawing(ScreenOutput())
Buffer = DrawingBuffer() ; Get the start address of the screen buffer
Pitch = DrawingBufferPitch() ; Get the length (in byte) took by one horizontal line
PixelFormat = DrawingBufferPixelFormat() ; Get the pixel format.
For i=1 To 100000
x=Random(#ScreenWidth-1)
y=Random(#ScreenHeight-1)
col=RGB(Random(255),Random(255),Random(255))
*Line.Pixel = Buffer + (Pitch*y) + (x*4) ; <---Pixelformat sollte 4 sein
*Line\Pixel=col
Next
StopDrawing()
ExamineKeyboard()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
Else
MessageRequester("Error","Can't open the screen !",0)
EndIf
Debug Pixelformat
End