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.

Code Snippets / [DBP] Function to make programs run in widescreen (Easy to implement)

Author
Message
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 9th Aug 2007 15:05
Here's a function that will make DBPro programs render in widescreen. If you're not using a widescreen monitor, you'll see those black bands at the top and bottom like in the movies. All you have to do is call widescreen() with the aspect ratio you want. 1.777 (aka 16:9) is standard. You can even make the screen taller than it is wide by using a ratio less than 1.

An example to show how easy it is to use,



And the stand alone function,



This sig has been viewed times.
Mr Kohlenstoff
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 9th Aug 2007 17:28
Oh nice.. I didn't even know the command. Thanks, would be an interesting feature for "cinema-atmosphere" in game-sequences.

Visit the DBPro - Speed up your game-Thread. http://forum.thegamecreators.com/?m=forum_view&t=88661&b=1
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 11th Aug 2007 23:07
Brilliant! This is just absolutely brilliant!

I never would have thought to see an accurate wide screen effect for DBPro.

This is definitely going to come in handy.

Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 11th Aug 2007 23:42 Edited at: 18th Jan 2009 00:11
Thanks I just found out another trick, here's an example of how to make the program automatically run in the highest resolution avaibable. No more need for "do you want to run this in 800x600 or 1280x1024 mode?" messages! Doesn't even require using perform checklist for display modes.



Note: Must be compiled under 640x480 Windowed Fullscreen from the IDE for best effect, it will then change at runtime to ????x???? Fullscreen Exclusive.

Your signature has been erased by a mod - mediafire image wasn't found
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 12th Aug 2007 04:18
Nice. I need to use something like this to stick the black side bars on when people use widescreen monitors.
A problem with your code is that it seems you are assuming square pixels.
This means that if the program is running in fullscreen windowed, i.e. emulating the resolution you specify, then you can have, say, 800 by 600 running on a widescreen monitor, and the aspect ratio set to 4:3, and it will fill the screen. I tried running my game on a mate's comp with a widescreen monitor and it was all stretched out.
Basically you still have to make sure that you are running a 4:3 resolution on a 4:3 fullscreen monitor, and a 16:10 resolution on a 16:10 screen etc.
Correct me if i'm wrong though.

SUPER BADASS SPACESHIP X: WEBSITE
FORUM TOPIC
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 12th Aug 2007 14:48 Edited at: 18th Jan 2009 00:12
Quote: "A problem with your code is that it seems you are assuming square pixels."


Square pixels? What's that?

Quote: "Basically you still have to make sure that you are running a 4:3 resolution on a 4:3 fullscreen monitor, and a 16:10 resolution on a 16:10 screen etc."


Well, with this function, if you use 4:3 resolution it won't look stretched even on widescreen monitors if that's what you mean.

Your signature has been erased by a mod - mediafire image wasn't found
geecee3
20
Years of Service
User Offline
Joined: 25th Feb 2004
Location: edinburgh.scotland.
Posted: 3rd Sep 2007 18:21
its what you get on virtually any monitor if you run it at native res, regardless of screen aspect ratio. pixel apsect of 1:1, if the pixel apsect was any different circles would be ellipses at the monitor native res. by forcing a 16:10 widescreen to display a 4:3 resolution, you effectivley change the pixel aspect on the display causing the stretched image, at native res the stretching dissapears bacause the pixel aspect is once again 1:1.

Ohd Chinese Ploverb say : Wise Eskimo, not eat yerrow snow.
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 3rd Sep 2007 20:33
Oh, I see now. I didn't think any monitor manufacturer would ever make a monitor without a 1:1 pixel ratio, but changing the resolution can make the pixel ratio change. I have a 5:4 LCD monitor and so plotting a dot in 1280x1024 looks like it should, but plotting it in 1280x768 actually lights up 4 pixels because the physical position of pixels on LCD monitors can't be changed and so it estimates.

Login to post a reply

Server time is: 2024-11-22 18:23:43
Your offset time is: 2024-11-22 18:23:43