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 Discussion / 4:3 aspect ratio on a widescreen monitor

Author
Message
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 7th Oct 2011 06:36 Edited at: 8th Oct 2011 02:02
DBC doesn't seem to handle widescreen resolutions too well. On either side of the display there is a little area that doesn't really refresh properly so there can be "smeared" graphic diplays.

I think this is due to DBC being designed to display only on 4:3 ratio screens (320,240 640,480 800,600 1024,768 etc.) And if you do use one of these resolutions on a widw screen in full screen mode, it may stretch across the whole screen and be skewed wide.

There is a setting in the setup.ini file that will make a full screen window with a centered view sized to whatever resolution you setup. This allows for setting 4:3 resolutions without them being skewed.

Under SETTINGS , look for windowmode= and set it to 1



The thing to note though is no matter what you set the bit depth to, it will use the desktops bit depth. In the following example, my desktop screen resolution is 1280x768x32 . I'm going to create a 4:3 DBC game screen of 800,600,16 after setting the setup.ini file to windowmode=1 . Even though I am setting the bitdepth to 16 and DBC reports the depth as such, if I make a memblock from the screen I can querry the true bitdepth:



This makes a 4:3 visual area without any skewing on my widescreen display.

Note however, that in window mode, the set gamma command doesn't seem to work.

Enjoy your day.
Fluffy Rabbit
User Banned
Posted: 7th Oct 2011 23:45
Very useful, but how would you detect the current resolution of the desktop so as to display a 4:3 screen in the maximum possible resolution? Centering a mini-screen doesn't sound attractive to me. In a solution like FreeBASIC, it's as simple as calling screeninfo, but in DarkBASIC it only returns the maximum possible resolution of the monitor.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Oct 2011 01:48 Edited at: 8th Oct 2011 02:04
Quote: "Very useful, but how would you detect the current resolution of the desktop so as to display a 4:3 screen in the maximum possible resolution? Centering a mini-screen doesn't sound attractive to me. In a solution like FreeBASIC, it's as simple as calling screeninfo, but in DarkBASIC it only returns the maximum possible resolution of the monitor. "


Well, with a little Win32 api function calling, we can do it! I don't know how long this 32 bit windows code will be relavent, but right now it should work on both 32 bit and 64 bit version of windows; but anyway, here ya go! Remember, this is based on being in windowmode=1 under SETTINGS in the setup.ini :



Enjoy your day.
Fluffy Rabbit
User Banned
Posted: 8th Oct 2011 02:54
Mommy, help me, I'm drowning in too much code! Somebody turned the knob too far to the left and now my bathtub is overflowing with commands I don't understand! I can understand why you would need to call a DLL, but two of them? Two DLLs? Don't bother explaining to me how this works. Perhaps I can simplify it on my own time. Wow. Latch, you go above and beyond.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Oct 2011 03:04
I need the DLLs to querry the desktop dimensions and bit depth. One dll holds the the screen size, the other holds the bit depth.

Enjoy your day.
Fluffy Rabbit
User Banned
Posted: 8th Oct 2011 05:43
@Latch-

Whatever. I used your code in the newest release of the Dark Survival 2 Engine. You smart I not.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 29th Oct 2011 14:51 Edited at: 29th Oct 2011 14:53
You do not need any DLLs to find out the available screen resolution in DB/DBP. Use instead the SetBestScreen()-function to find out the best available resolution.

Here you can find the function: http://forum.thegamecreators.com/?m=forum_view&t=128399&b=6
Fluffy Rabbit
User Banned
Posted: 30th Oct 2011 01:42 Edited at: 2nd Dec 2011 00:10
Quote: "You do not need any DLLs to find out the available screen resolution in DB/DBP. Use instead the SetBestScreen()-function to find out the best available resolution.

Here you can find the function: http://forum.thegamecreators.com/?m=forum_view&t=128399&b=6"


Mod Edit: Name calling, really?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Nov 2011 23:03
If I were a mod, I'd slap the hell out of you for a week fluffy.

Your signature has been erased by a mod please reduce it to no larger than 600 x 120.
enderleit
16
Years of Service
User Offline
Joined: 30th May 2007
Location: Denmark
Posted: 15th Nov 2011 17:26
Me too.

Fluffy Rabbit
User Banned
Posted: 16th Nov 2011 02:54
I'm only stating what everyone's thinking. Had you read the code that Mr. 2004 posted you'd understand what I mean.
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 28th Nov 2011 14:51
Not only that Fluffy,, but in the same thread that Atilla linked, the flaw he posted here was addressed. And a simplified snippet of using the .dll's was given, and the repsonse was "thanks!"

Atilla
Quote: "DBC always starts with 640x480 when not set to a different resolution. How do you determine the desktops resolution? "


Master Xilo
Quote: "like this:

+ Code Snippet
load dll "user32.dll",1
ScreenW=call dll(1,"GetSystemMetrics",0)
ScreenH=call dll(1,"GetSystemMetrics",1)
delete dll 1
"


Atilla
Quote: "Great thanks"


~ZENassem
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Nov 2011 07:20
@ Fluffy Rabbit - solved your problem : http://www.youtube.com/watch?v=NjqpzUU7ClA

zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 30th Nov 2011 17:34
And here I was hoping for the Saruman version....

~ZENassem
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 2nd Dec 2011 00:13
Is he a robot? I can't stop watching!

Login to post a reply

Server time is: 2024-04-25 13:59:59
Your offset time is: 2024-04-25 13:59:59