PixelFormat in ScreenOutput() : Bug or Code error ?!

Just starting out? Need help? Post your questions and find answers here.
BillBoard_67
User
User
Posts: 10
Joined: Wed Feb 21, 2024 9:57 am

PixelFormat in ScreenOutput() : Bug or Code error ?!

Post by BillBoard_67 »

Hi Everyone,

I'm curious to know why the DrawingBufferPixelFormat is always at 3 octets in my code when drawing on a screen even if ScreenDepth is 32 :

Is it a bug or an error in my code (code reduced for testing) ?

Code: Select all

width_screen  = 1000
height_screen = 1000
InitSprite()
InitKeyboard()
OpenWindow(0,0,0,width_screen,height_screen, "", #PB_Window_NoGadgets | #PB_Window_BorderLess )
OpenWindowedScreen(WindowID(0), 0,0,width_screen,height_screen)
define.l pixelformat
define.s pix_f

Repeat
  Repeat
  Until WindowEvent() = None
  ExamineKeyboard()
  ClearScreen(0)
StartDrawing(ScreenOutput())
      DrawingMode(#PB_2DDrawing_AllChannels)     
      PixelFormat = DrawingBufferPixelFormat()  ; Get the pixel format.      
 StopDrawing() 
  If PixelFormat & #PB_PixelFormat_32Bits_RGB Or PixelFormat & #PB_PixelFormat_32Bits_BGR
    pix_f = "SCREEN PIXEL : 4 octets"
  Else
    pix_f = "SCREEN PIXEL : 3 octets"
  EndIf
  Debug pix_f
  Debug ScreenDepth()
 FlipBuffers()
  
Until KeyboardReleased(#PB_Key_Escape)

Thanks for your answers ;)