Finding the resolution of the desktop

BlitzMax Forums/BlitzMax Programming/Finding the resolution of the desktop

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I ripped this out of my Windows screen saver code. I haven't got a clue how you'd do the Mac and Linux stuff. It's a start though. ;o)
Strict

Local w, h, d, r

DesktopGraphics(w, h, d, r)
Print "Desktop : " + h + "x" + w + "x" + d + "@" + r + "Hz"

End 

Function DesktopGraphics(width Var, height Var, depth Var, refresh Var)
?Win32 
	Local hdc = GetDC(GetDesktopWindow())
	If hdc = Null Then Return True
	
	width = GetDeviceCaps(hdc, HORZRES)
	height = GetDeviceCaps(hdc, VERTRES)
	
	depth = GetDeviceCaps(hdc, BITSPIXEL)	
	If depth < 8
		depth = GetDeviceCaps(hdc, PLANES)
	EndIf	
	
	refresh = GetDeviceCaps(hdc, VREFRESH)
	If refresh < 60 Then refresh = -1
?MacOS
	'???
?Linux
	'???
?
End Function