Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / how to do multi screen resoulution?

Author
Message
sweldon
14
Years of Service
User Offline
Joined: 27th Dec 2011
Location: Delaware,Ohio
Posted: 22nd Jan 2013 03:17
How does one make a menu with multiple screen resolution options before game start , and keep this setting thru the game ?

Some times logic is a conclusion of the illogical ITems
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 22nd Jan 2013 03:52 Edited at: 22nd Jan 2013 03:54
Check out Screen Display Mode Function For DBC (by TDK) for a great example of picking a screen resolution.

Once the user has chosen, write the info to a file. Each time the app starts, do a check for this file. If it doesn't exist, ask for a resolution. If it does exist, open the file, read the value, and set the resolution!

Edit: Oh yeah, the code is for DBC, but it should still work in DBP.

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
sweldon
14
Years of Service
User Offline
Joined: 27th Dec 2011
Location: Delaware,Ohio
Posted: 22nd Jan 2013 03:56
thank you .

Some times logic is a conclusion of the illogical ITems
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 22nd Jan 2013 04:22 Edited at: 22nd Jan 2013 04:25
There's more to it than picking screen resolutions.
Lets look at this problem a little deeper.

Game Media
If you change the screen resolution with Set Display Mode, you will need to reload all of the media your game is using. It has the same effect as losing the Screen Device. All images, sprites, objects loaded will be deleted and will need to be reloaded if you want to continue to use them. This can be very problematic if you are using an in-game menu.

Screen Aspect Ratio
If you change the resolution, the screen can stretch different ways since most resolutions have different screen shapes and form factors. You need to correct the Aspect Ratio of the screen otherwise the game will look stretched.

Secondary Cameras
If you use additional cameras for effects like reflective water, HDR, Bloom, etc. In most cases those cameras will need their Aspect Ratio to match the Aspect Ratio of the main camera. Otherwise you will see errors, and tear your hair out wondering why.

Desktop Resolution
To a lesser importance, if you are trying to establish a best possible resolution and there is no existing setting or default. Don't set the resolution higher than the desktop resolution. It's a detail that's easy to overlook.

Resolution Reversion
A popular mechanism these days (for good reason) is to provide a timer countdown after changing resolutions in case an undetectable problem occurs and the player can't see the screen. The idea is that the game will swap back to the old resolution when the timer runs out.


A few of these things are easier said than done. However, keeping these points in mind will help you write better software.

Login to post a reply

Server time is: 2026-07-07 10:12:57
Your offset time is: 2026-07-07 10:12:57