Page 1 of 1
Games & Screens
Posted: Tue Jul 20, 2004 3:44 pm
by MadMax
I'm making this game, it's realy meant to work on a non-windows screen, but because some cards due mainly to faulty drivers make these screens flicker horribly; I've thought of having the option of using a windowed screen with no borders. Problem is that the desktop resolution has to be that of the game (1024x768) I would like to be able to change the desktop resolution, I know this is a touchy subject (I would of course give the option of this not happening, and will always restore the desktop to the original setting on exit).
I would be gratefull if anyone can tell me how to do this (change the desktop resolution)
Even if I finaly decide not to use it, I would like to know how to do it.
Posted: Tue Jul 20, 2004 4:02 pm
by Codemonger
there is a really well done library that will handle what you want on purearea ..
http://www.purearea.net/pb/english/index.htm
the library is
ScreenEx
Posted: Tue Jul 20, 2004 8:44 pm
by MadMax
Thanks codemonger, but I'd rather not depend on a 3rd party lib
So far I've found ChangeDisplaySettings and DEVMODE
I guess one would need to use something like ChangeDisplaySettings_(devmode,flags) but I'm not sure how to use this.
Posted: Tue Jul 20, 2004 9:11 pm
by Codemonger
The library isn't really third party because its a static library it gets linked into your .exe file. So no need to add extra files for your final program.
Anyway if you call the User32 library you should enumerate the available display modes first using
EnumDisplaySettings
http://msdn.microsoft.com/library/defau ... s_84oj.asp
anyway heres a link to the microsoft version ... I believe all ScreenEX does is wrap these commands up into some nice easy to read commands. Gotta love BASIC.
How come u don't use the internal command ExamineScreenModes() ?
Posted: Tue Jul 20, 2004 9:35 pm
by blueznl
enumdisplaysettings() is what i also use for mutli monitor stuff, do a search on the board for more details...
Posted: Tue Jul 20, 2004 9:45 pm
by PolyVector
The library isn't really third party because its a static library it gets linked into your .exe file
It's still a third party lib

Posted: Tue Jul 20, 2004 10:29 pm
by thefool
hmm
The library isn't really third party
is it 2½ party then 8O
i belive third party means that it is not made by the pb developers, but someone outside
Posted: Wed Jul 21, 2004 1:44 am
by VPureBasic
Hi MadMax And All,
CodeMonger wrote:
Thx CodeMonger... This library is not a 3rd party lib... it's a user library! And like any others PureBasic functions, you do not need external lib... PB linked all in the excutable file.
Roger
Posted: Wed Jul 21, 2004 10:54 am
by neuronic
Hi there
Personaly I would not recommend you to use ScreenEX library. The reson: I have been working on a game for months now and everything have been fine so far. But when I went to my friend's to test the game the whole screen was messy. I could not see anything. I used screenEx lib to change the resolution. The problem was that my friend uses a different resolution for desktop and He has an ATI card ( I have a GeForce 4) so I suppose ScreenEx lib does something with the frequency of the screen. But it makes everything wrong.
So I tried to use ChangeDisplaySettings() and it seems to work fine.
Check the CodeArchive there is a small code to do it.
Neuronic
Posted: Wed Jul 21, 2004 12:29 pm
by fweil
Maybe some help here to list the available modes.
From this, you can adapt your code according to the detected mode or adapt the mode.
Code: Select all
#ENUM_CURRENT_SETTINGS = -1
#ENUM_REGISTRY_SETTINGS = -2
EnumDisplaySettings_(#NULL, #ENUM_CURRENT_SETTINGS, @Result.DEVMODE)
Debug "Bits per pixel=" + Str(Result\dmBitsPerPel) + " Pixels width=" + Str(Result\dmPelsWidth) + " Pixels height=" + Str(Result\dmPelsHeight) + " Frequency=" + Str(Result\dmDisplayFrequency)
EnumDisplaySettings_(#NULL, #ENUM_REGISTRY_SETTINGS, @Result.DEVMODE)
Debug "Bits per pixel=" + Str(Result\dmBitsPerPel) + " Pixels width=" + Str(Result\dmPelsWidth) + " Pixels height=" + Str(Result\dmPelsHeight) + " Frequency=" + Str(Result\dmDisplayFrequency)
i = 0
While EnumDisplaySettings_(#NULL, i, @Result.DEVMODE)
Debug "Mode + " + Str(i) + " Bits per pixel=" + Str(Result\dmBitsPerPel) + " Pixels width=" + Str(Result\dmPelsWidth) + " Pixels height=" + Str(Result\dmPelsHeight) + " Frequency=" + Str(Result\dmDisplayFrequency)
i + 1
Wend
Rgrds