Games & Screens
Games & Screens
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.
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.
-
Codemonger
- Enthusiast

- Posts: 384
- Joined: Sat May 24, 2003 8:02 pm
- Location: Canada
- Contact:
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
http://www.purearea.net/pb/english/index.htm
the library is ScreenEx
<br>"I deliver Justice, not Mercy"
    - Codemonger, 2004 A.D.
    - Codemonger, 2004 A.D.
-
Codemonger
- Enthusiast

- Posts: 384
- Joined: Sat May 24, 2003 8:02 pm
- Location: Canada
- Contact:
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() ?
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() ?
<br>"I deliver Justice, not Mercy"
    - Codemonger, 2004 A.D.
    - Codemonger, 2004 A.D.
enumdisplaysettings() is what i also use for mutli monitor stuff, do a search on the board for more details...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
-
PolyVector
- Enthusiast

- Posts: 499
- Joined: Wed Sep 17, 2003 9:17 pm
- Location: Southern California
- Contact:
-
VPureBasic
- User

- Posts: 59
- Joined: Fri Apr 25, 2003 6:09 pm
- Location: Quebec - Canada
Hi MadMax And All,
CodeMonger wrote:
Roger
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.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
Roger
Everything is possible with PureBASIC... All you're missing is imagination!
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
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
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.
Rgrds
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
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.

