Blitz3D+ Command Reference

GraphicsDepth ( )

Parameters

None.

Description

Returns the colour depth of the current graphics display, in bits.

This reports the depth the display was opened with. On the modern runtime the engine renders 32-bit colour, and asking Graphics for depth 0 (the default) reports 32 here.

Classic code used this to branch between 16 and 32-bit drawing paths; today it is mostly informational.

See also: GraphicsWidth, GraphicsHeight, Graphics.

Example

; GraphicsDepth Example
; ---------------------

; Depth 0 lets Blitz choose the best colour depth for the video card
Graphics 640,480,0,2
SetBuffer BackBuffer()

angle#=0

While Not KeyDown(1)

    Cls

    ; A ball circling the screen centre
    angle=angle+2
    Color 0,255,128
    Oval 300+Cos(angle)*180,220+Sin(angle)*140,40,40,1

    Color 255,255,255
    Text 0,0,"Esc: exit"
    Text 0,20,"GraphicsDepth() = "+GraphicsDepth()+" bit - the depth Blitz chose for us"

    Flip

Wend

End

Index