Current desktop resolution

BlitzMax Forums/BlitzMax Beginners Area/Current desktop resolution

jkrankie(Posted 2007) [#1]
Is there a way to get the current desktop resolution in blitzmax? i can't see any way in the docs.

Cheers
Charlie


Yan(Posted 2007) [#2]
Yup.


jkrankie(Posted 2007) [#3]
I get this message when trying to use the module

/usr/bin/ld: table of contents for archive: /Users/c-knight/Desktop/BlitzMax/mod/desktopext.mod/desktopext.release.macos.ppc.a is out of date; rerun ranlib(1) (can't load from it)
collect2: ld returned 1 exit status
Build Error: Failed to link /Users/c-knight/Desktop/BlitzMax/tmp/untitled1.app/Contents/MacOS/untitled1
Process complete


jkrankie(Posted 2007) [#4]
but it seems to work ok on windows.

Cheers
Charlie


Yan(Posted 2007) [#5]
Hmm...Have you tried rebuilding the module?


ImaginaryHuman(Posted 2007) [#6]
Does the grab desktop pixmap thing work on all platforms?


EOF(Posted 2007) [#7]
Desktop.Width
Desktop.Height

?


Yan(Posted 2007) [#8]
I just want to make it clear that I didn't write the above module, it was written by d-bug.

AD, I believe the grab desktop function is Win32 only.

JB, only if you have MaxGUI. The module allows you to get the desktop's colour depth too. :o)


d-bug(Posted 2007) [#9]
hehe, it's living again... :)

DesktopPixmap, DesktopMouseX and DesktopMouseY are Win32 only, AngelDaniel.

I can't help you with that problem, jkrankie. The OSX part was written by hamZta.

cheers


MGE(Posted 2008) [#10]
FYI: I just grabbed the DesktopExt.Mod written by D-Bug to query the desktop width/height (I don't have MaxGui) and it appears to be working great! Thanks D-Bug!


MGE(Posted 2008) [#11]
D-Bug: The only suggestion I can make is a simple function to return the desktop ratio, granted it's trivial but since you have all of the other cool functions, why not? :) Thanks again for creating this mod.


JazzieB(Posted 2008) [#12]
I get this message when trying to use the module

/usr/bin/ld: table of contents for archive: /Users/c-knight/Desktop/BlitzMax/mod/desktopext.mod/desktopext.release.macos.ppc.a is out of date; rerun ranlib(1) (can't load from it)
collect2: ld returned 1 exit status
Build Error: Failed to link /Users/c-knight/Desktop/BlitzMax/tmp/untitled1.app/Contents/MacOS/untitled1
Process complete

You may have to rebuild the module before you can use it. I seem to remember having to do this myself, although it was a long time ago. Also, check it's in the correct folder.

D-Bug: The only suggestion I can make is a simple function to return the desktop ratio, granted it's trivial but since you have all of the other cool functions, why not? :) Thanks again for creating this mod.

Local ratio:Float=DesktopWidth/DesktopHeight
That's just how trivial it is. Admittedly, it does assume that the user has their desktop at a square pixel resolution and not something like 1280x1024 on a 4:3 monitor. But then, that's their fault ;o)


GfK(Posted 2008) [#13]
FYI: I just grabbed the DesktopExt.Mod written by D-Bug to query the desktop width/height (I don't have MaxGui) and it appears to be working great!
Well, if anything was wrong with it, he's had a year to fix it since this thread was started.


d-bug(Posted 2008) [#14]
MGE: No Problem. ;)

Since I'm on Mac too, I can confirm, that it is working well with OSX.

Ratio is a rather useless feature, but why not...

cheers

~edit~
Find the new version here! Now with DesktopRatio() to get the aspect ratio of the current desktop. It will return strings like "4:3", "16:10" or whatever your ratio is. ;)

cheers^2


CGV(Posted 2008) [#15]
How reliable is the DesktopHertz function.

Any guarantee it will return the true refresh rate of the monitor across all the various video cards and drivers?

Or is it one of those things were the driver lies!?!


d-bug(Posted 2008) [#16]
It's an API-Call, so i give no guarantee for it, but in the past two years there where no issues reported with this function.