Getting desktop colour depth

Blitz3D Forums/Blitz3D Programming/Getting desktop colour depth

Boiled Sweets(Posted 2004) [#1]
There has been many posts about how to get the desktop resolution but how do you get the desktop colour depth?


Uber Lieutenant(Posted 2004) [#2]
I don't know the answer to this, myself. So I did a bit of searching for you and found a DLL userlib that extends Blitz's OS functions (which I would assume includes current resolution and color depth). I hope this is what I think it is.

http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=Rob__Hutchinson01222002120752&comments=no


BlitzSupport(Posted 2004) [#3]
I won't swear to this off-hand without testing, but I seem to recall that calling GraphicsDepth () before setting a graphics mode will do it. Perhaps it was a particular incarnation of Blitz that did it...?


Boiled Sweets(Posted 2004) [#4]
Here I go again answering my own questions. Another way...

bank = CreateBank(4)
API_CopyMemoryPntrAddr bank,FrontBuffer() + 100,4
depth = PeekInt(bank,0)
FreeBank bank

and userlib adjustment:

lib "kernel32.dll"
API_CopyMemoryPntrAddr%(Destination*,Source%,Length%) : "RtlMoveMemory"


poopla(Posted 2006) [#5]
Just looked through blitz'sys, that's good stuff.