DesktopExtension

BlitzMax Forums/BlitzMax Module Tweaks/DesktopExtension

d-bug(Posted 2006) [#1]
Hi,
this is a little module wich can help getting the desktop resolution on Win32, MacOS and Linux. It is not testet on Intel based Mac's.

Usage :
Import dbug.desktopext
Print DesktopWidth()     'Get the width of the current desktop
Print DesktopHeight()    'Get the height of the current desktop
Print DesktopDepth()     'Get the depth of the current desktop
Print DesktopHertz()     'Get frame rate of the current desktop


Get all the information at once :
Import dbug.desktopext
Local dwidth:int
Local dheight:int
Local ddepth:int
Local dhertz:int
GetDesktopMode (dwidth, dheight, ddepth, dhertz)


Official home of DesktopExtension

cheers


ImaginaryHuman(Posted 2006) [#2]
Great man. I don't think you'll have any problem on the intel mac since, after all, it's basically the same operating system just compiled for a different cpu. It should do exactly the same thing.

These commands are making my life a lot easier. Thanks again!


ImaginaryHuman(Posted 2006) [#3]
I think this module should be officially incorporated into BlitzMax, or at least as an official public module.


Russell(Posted 2006) [#4]
By coincidence I was looking for exactly this feature just a few weeks ago!

Thanks!

Russell


d-bug(Posted 2006) [#5]
Version 1.01

Safety update for win32 part. Added ReleaseDC wich isn't really needed, but might be saver now.

Download from first post


ImaginaryHuman(Posted 2006) [#6]
Thanks D:Bug. I'm also glad someone else is using this as well, it's very handy.

Hey D:Bug .... there are two lines in desktopext.bmx that you still need to change in order for it to compile on the mac. You refer to GetBPP() twice, but within macscreen.c the function is called GetBits(). You either need to change macscreen.c to say GetBPP(), or change the two calls in desktopext.bmx to say GetBits(). I did the latter, and recompiled it. Otherwise it fails to build the module.


d-bug(Posted 2006) [#7]
@AngelDaniel
Sorry man, but I've done this a long time ago?! Didn't you replace the macscreen.c with the one from the archive? In this file I've renamed GetBits to GetBPP to fix this bug.


ImaginaryHuman(Posted 2006) [#8]
Um ya, after I changed it in the .bmx file I noticed it didn't compile, doh.... yah you are right, it's already okay as is :-D

I think I might just use the GetDesktopMode() function, because the other functions you have in there are no more efficient. If they were doing less work I could see using them, but since they call GetDesktopMode() anyway they're a bit redundant. No offence.


d-bug(Posted 2006) [#9]
okay, version 1.02 now...

I've had to change the scope from dbug.mod to chaos.mod. This was needed becourse we now have our own module-server in Germany and I'm member of a team, so we've decided to use a team-scope. Read more Information about synchronizing our team modules (currently only this one) from the readme.txt provided in this Module.

Usage changed from:
Import dbug.desktopext

to:
Import chaos.desktopext


cheers


ImaginaryHuman(Posted 2006) [#10]
Are there any other changes other than the name change?


d-bug(Posted 2006) [#11]
oh sorry, I've forgot to mention that there are no other changes!


d-bug(Posted 2006) [#12]
5 month since I've last updated... Long time. Okay currently DesktopExtension reached Version 1.07. Since we've got a own module-section on www.Chaos-Interactive.de you have to go there to get latest Version.

Updated all links.


d-bug(Posted 2007) [#13]
Version 1.11 out now:

+ DesktopX() (Win32)
+ DesktopY() (Win32)
+ DesktopCount() (Win32, MacOS)
+ Multiple monitor support for DesktopWidth() (Win32, MacOS)
+ Multiple monitor support for DesktopHeight() (Win32, MacOS)
+ Multiple monitor support for DesktopDepth() (MacOS)
+ Multiple monitor support for DesktopHertz() (MacOS)


JazzieB(Posted 2007) [#14]
Hi. Great little mod there. Works great under Windows, but I get an error when trying to compile the module under MacOS (Intel).

On line 121 of desktopext.bmx I get an "identifer 'screen' not found" error when compiling modules. It's the line that says...
Local display:Byte Ptr[] = New Byte Ptr[screen+1]

Any ideas?

EDIT - Well, I seemed to have solved the problem for the moment by simply commenting out the SuperStrict at the top of the module code. Probably not the most elegant of situations, but it works for the moment!


d-bug(Posted 2007) [#15]
Oops!
Thats becourse the variable 'screen' isn't defined in DesktopCount().
Please download it again. I've hopefuly fixed this bug in Version 1.12. I can't test the Mac Version by my own, becourse i don't own one of these pretty machines.
Thank you for the bugreport.


JazzieB(Posted 2007) [#16]
No worries. Just tested and the module compiled without a hitch on my Mac.

Nice little mod, by the way. Good job.


d-bug(Posted 2008) [#17]
Version 1.13 out now!

As requested I've added a ne DesktopRatio () to get the aspect-ratio of the current desktop. It will return Strings like "4:3" or "16:10"!

Download link in first thread.

Have fun...


d-bug(Posted 2009) [#18]
Version 1.14 and 1.15 out Now.

Kick me, I've forgot to update this versions on our website. :/

Version 1.14:
Added DesktopWallpaper () to query the path to - surprise surprise - desktops wallpaper!

Version 1.15
Added multiple Screen support to DesktopPixmap ().

Link as allways in the first post, or my signature!

cheers


GfK(Posted 2009) [#19]
Downloaded 1.15 from your site just now.

The documentation doesn't mention anything beyond 1.13, and DesktopPixmap still has no dual monitor support. I'm not sure you've uploaded the right version?


d-bug(Posted 2009) [#20]
Wow, I'm such an idiot these days -.-
I'm very sorry about that and will fix it this evening (hopefully).

Thank you for the report.

~edit~
Is fixed now. Please download it again.


d-bug(Posted 2010) [#21]
As requested by some users in this thread, I've fixed some issues with BM1.39+.

- Renamed functions DesktopWidth, DesktopHeight, DesktopDepth and DesktopHertz to DesktopWidthMulti, DesktopHeightMulti a.s.o...
- Fixed DesktopRatio to prevent compiling problems

In short words: 1.18 is out now.

(1.17 was not uploaded but contains DesktopMouseX and DesktopMouseY support for MacOSX!)


GfK(Posted 2010) [#22]
Cool, can recompile my game with 1.39 now. :)


Hujiklo(Posted 2010) [#23]
Can't find interface for module 'chaos.desktopext'

I've 1.18 version and am importing as 'Import chaos.desktopext'

I can't compile this module at all :(

I'm on Bmax version 1.39

*Edit - never mind, just noticed the Bmax 1.39 does the job now..Thanks anyhow.


GfK(Posted 2010) [#24]
As requested by some users in this thread, I've fixed some issues with BM1.39+.

- Renamed functions DesktopWidth, DesktopHeight, DesktopDepth and DesktopHertz to DesktopWidthMulti, DesktopHeightMulti a.s.o...
- Fixed DesktopRatio to prevent compiling problems

In short words: 1.18 is out now.


I went to your site, but there it states:
Only for BlitzMax versions prior 1.39

So, where can I download a version that does work with 1.39?


GaryV(Posted 2010) [#25]
GfK: On the site the text "Only for BlitzMax versions prior 1.39" is part of the description for the older version 1.16.

If you download the latest version 1.18 it should work with BM 1.39.


GfK(Posted 2010) [#26]
Yep - was just about to reply having just tested it anyway! :)


d-bug(Posted 2010) [#27]
Yep, I was to lazy to change the text. :>