Games & Screens

Advanced game related topics
MadMax
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Oct 06, 2003 11:56 am

Games & Screens

Post 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.
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post 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
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
MadMax
Enthusiast
Enthusiast
Posts: 237
Joined: Mon Oct 06, 2003 11:56 am

Post 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.
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post 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() ?
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

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... )
PolyVector
Enthusiast
Enthusiast
Posts: 499
Joined: Wed Sep 17, 2003 9:17 pm
Location: Southern California
Contact:

Post 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 :)
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post 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
VPureBasic
User
User
Posts: 59
Joined: Fri Apr 25, 2003 6:09 pm
Location: Quebec - Canada

Post by VPureBasic »

Hi MadMax And All,

CodeMonger wrote:
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
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
Everything is possible with PureBASIC... All you're missing is imagination!
neuronic
Enthusiast
Enthusiast
Posts: 112
Joined: Sat Apr 26, 2003 11:38 pm
Contact:

Post 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
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post 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
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.
Post Reply