Browse Source

Added BitsPerPixel() to SDLDisplayMode.

Brucey 3 years ago
parent
commit
76d8b5d194
1 changed files with 7 additions and 0 deletions
  1. 7 0
      sdlvideo.mod/common.bmx

+ 7 - 0
sdlvideo.mod/common.bmx

@@ -426,4 +426,11 @@ Struct SDLDisplayMode
 	bbdoc: driver-specific data, initialize to 0
 	bbdoc: driver-specific data, initialize to 0
 	End Rem
 	End Rem
 	Field driverdata:Byte Ptr
 	Field driverdata:Byte Ptr
+
+	Rem
+	bbdoc: Returns the bits per pixel for the format
+	End Rem
+	Method BitsPerPixel:Int()
+		Return (format Shr 8) & $FF
+	End Method
 End Struct
 End Struct