Getting the bit depth of the 'desktop' on all platforms

Is this possible (and reliable?)

I’m using Blitz Research’s BlitzMax programming language, which allows using one of three graphics drivers for Windows (although Bmax itself is available for Win32, Linux and MacOS):

  • OpenGL total control (Win32, Linux, MacOS)
  • Max2D: OpenGL “under the hood” (All 3 platforms)
  • Max2D: DirectX “under the hood” (Win32 only)

I’m writing a cross-platform program that needs to know the depth of the user’s desktop. Can this be done? I’ll even accept a ‘kludge’ workaround as long as it does not use OGL commands past v1.5