Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Wide screen + Fullscreen + Allegro = ?

Credits go to Kibiz0r, Kris Asick, and Thomas Fjellstrom for helping out!
This thread is locked; no one can reply to it. rss feed Print
 1   2 
Wide screen + Fullscreen + Allegro = ?
Albin Engström
Member #8,110
December 2006
avatar

Seems like I'll have to scrap the widescreen+fullscreen support :/,
I can't think of a solution worth it's downside. :(

Kris Asick
Member #1,424
July 2001

Ok, here's a solution you'll like.

1. Ask the player the very first time they start your game whether they're using a standard or widescreen monitor. Store the answer into an options file.

2. When widescreen is selected, you can assume that the standard vertical will be present, such as 480, so just use get_gfx_mode_list() to get a list of valid display modes and choose whichever mode has the greatest X resolution with the Y resolution you desire.

3. Have an options screen where the user can switch between standard and widescreen. (Remember that you have to be running in SWITCH_BACKAMNESIA (fullscreen) or SWITCH_BACKGROUND (windowed) under Windows using set_display_switch_mode() before making additional calls to set_gfx_mode()... Or you just simply tell the user that changes will be applied when they restart the program.)

Simple enough, right? If the user doesn't understand that first question they probably aren't going to care if the game looks right or not.

--- Kris Asick (Gemini)
--- http://www.pixelships.com

--- Kris Asick (Gemini)
--- http://www.pixelships.com

Runesabre
Member #7,573
August 2006
avatar

That's effectively the solution I have come up with since I haven't found a programmatic way of detecting the monitor aspect yet.

My installer asks the player if they have a widescreen monitor. There's an option for "I don't know" at which point I then use get_resolution_depth() as a best guess.

_______________
Runesabre
Connecting People through Inspiring Interactive Entertainment
Enspira Online

Albin Engström
Member #8,110
December 2006
avatar

I just realized that 480/9 * 16 != valid resolution (853.480), it should be 848.480 :/.. no wonder it didn't work. but that means 16:9 is sort of a lie..

Kris Asick said:

When widescreen is selected, you can assume that the standard vertical will be present, such as 480, so just use get_gfx_mode_list() to get a list of valid display modes and choose whichever mode has the greatest X resolution with the Y resolution you desire.

but what happens if the greatest X resolution results in a wrong aspect ratio? because i take i that even resolutions that isn't suited for the monitor can still be used.

Thomas Harte
Member #33
April 2000
avatar

Quote:

so just use get_gfx_mode_list() to get a list of valid display modes and choose whichever mode has the greatest X resolution with the Y resolution you desire.

And remember that, per the docs:

Quote:

Note that the card parameter must refer to a real driver. This function fails if you pass GFX_SAFE, GFX_AUTODETECT, or any other "magic" driver.

So expect to have to write a fresh snippet of code for every platform you want to support, and add lots of #ifdefs and things like that. And don't expect your code to work correctly if anyone adds a new target to Allegro.

Allegro's rubbish like that.

Johan Halmén
Member #1,550
September 2001

Quote:

Running in 640x480 on a wide screen monitor results in pixels wider than high and it looks rather funny.

No problem. Check how people look at wide screen TV:s when the broadcasted image is 4:3. They stretch it and seem to have no problem with it. You may think it looks funny (I do!) but most people don't. They are so happy with their wide screen.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.

Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.

Albin Engström
Member #8,110
December 2006
avatar

Johan Halmén said:

No problem. Check how people look at wide screen TV:s when the broadcasted image is 4:3. They stretch it and seem to have no problem with it. You may think it looks funny (I do!) but most people don't. They are so happy with their wide screen.

Disgusting.

StevenVI
Member #562
July 2000
avatar

Do most widescreen TVs actually stretch like that? I have been graced with knowing someone so filthy rich as to have a very very large widescreen TV. For standard television shows it puts black bars on the left and right side of the screen, maintaining the aspect ratio. Perhaps it is just a top-of-the-line model?

__________________________________________________
Skoobalon Software
[ Lander! v2.5 ] [ Zonic the Hog v1.1 ] [ Raid 2 v1.0 ]

Tobias Dammers
Member #2,604
August 2002
avatar

Quote:

Do most widescreen TVs actually stretch like that?

No. Each and every one I've seen so far has a menu option somewhere, where you can select what to do with 4:3 material: stretch, fit width (cutting off top and bottom), fit height (adding black bars). But each and every one I've seen so far also is set to "stretch mode" by default, probably because retarded people would complain about the black bars or the missing subtitles and operator logos otherwise. And people generally won't change it, either because they don't know they can, or because they're too lazy to care. It's still stupid.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Kibiz0r
Member #6,203
September 2005
avatar

Some have a fancy stretch option that stretches the edges more than the middle, so you get more square pixels in the middle and more rectangular ones near the edges. It actually looks quite nice unless there is a wide panning shot, because then the camera appears to be moving faster toward the edges.

spellcaster
Member #1,493
September 2001
avatar

Quote:

For standard television shows it puts black bars on the left and right side of the screen, maintaining the aspect ratio. Perhaps it is just a top-of-the-line model?

Normally that's one of the many options.
My TV allows me to stretch it, watch it in the normal aspect ratio and offers me 3 other zoom and/or stretching methods.

The TV also detects black bars at the top/bottom of the signal and automatically adjusts the stretched area. It's kinda nifty.

I normally don't bother and let the TV choose the best way to display the image. Most movies are broadcast with borders anyway, so the actual aspect ratio isn't that far from 16:9 anyway. And while I notice the remaining difference, I don' care much. A quizshow, the news or maybe a late night show don't really suffer if the aspect ratio isn't correct.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Karadoc ~~
Member #2,749
September 2002
avatar

Quote:

Some have a fancy stretch option that stretches the edges more than the middle, so you get more square pixels in the middle and more rectangular ones near the edges. It actually looks quite nice unless there is a wide panning shot, because then the camera appears to be moving faster toward the edges.

That actually a clever idea. I wonder if my TV can do that. :p

-----------

Albin Engström
Member #8,110
December 2006
avatar

Widescreen support implemented 8-). It ain't very good yet, but it's there.

Thanks a lot guys! I'll give credits when this thread dies.
btw: when checking "The question has been answered to my satisfaction!" is it possible to post in this thread afterwards?

Kibiz0r
Member #6,203
September 2005
avatar

Yes, but you have to post in order to do that, so how do you intend on doing that after the thread dies?

Albin Engström
Member #8,110
December 2006
avatar

I think i might be misunderstood.. oh well, nothing new :).

Kibiz0r
Member #6,203
September 2005
avatar

I kind of intentionally misunderstood you to poke a tiny amount of fun at the way you phrased it, just so I would have something to say other than "Yes." -- I am a sad, pathetic little man. Thanks for the cookies. 8-)

Albin Engström
Member #8,110
December 2006
avatar

^^'

Runesabre
Member #7,573
August 2006
avatar

I think I might have figured out a programmatic way to make an educated best guess of the true aspect ratio of the player's monitor.

I spent some time analyzing the results of get_gfx_mode_list() on both my development computer which has a 4:3 monitor and my laptop which has a 16:10 screen.

After getting the list, I examined all resolutions that were 32bpp and 800x600 or higher.

With this subset of modes, I tracked the number of 4:3, 16:9 and 16:10 resolutions supported. On my 4:3 monitor, there were more 4:3 resolutions supported. On my laptop, there were more 16:10 resolutions supported.

I also noted that the highest resolution available matched the true aspect of the monitor. It would make sense to me that the highest resolution of a given monitor matched it's true aspect ratio.

Of course, this could simply be a coincidence but I thought perhaps this might be useful.

_______________
Runesabre
Connecting People through Inspiring Interactive Entertainment
Enspira Online

Dustin Dettmer
Member #3,935
October 2003
avatar

My solutions is to let people with widescreen crap get light warping glasses to play my game (aka say forget it :-/).

Monitors, if unable to actually support the modes they say they do, should have automagical scaling routines that make the pixels look right. And people should only buy those monitors because they are the only ones that make any kind of sense.

Sometimes capitalism drives me crazy...

Runesabre
Member #7,573
August 2006
avatar

I hear you, Dustin. The widescreen issue has been (surprisingly) one of my most frustrating issues developing my client. Not only the problem of not being able to succinctly detect the aspect ratio, but, other oddities like my laptop's lowest 16:10 resolution being 1280x800 whereas most machines support 960x600.

_______________
Runesabre
Connecting People through Inspiring Interactive Entertainment
Enspira Online

Albin Engström
Member #8,110
December 2006
avatar

Runesabre said:

With this subset of modes, I tracked the number of 4:3, 16:9 and 16:10 resolutions supported. On my 4:3 monitor, there were more 4:3 resolutions supported. On my laptop, there were more 16:10 resolutions supported.

I also noted that the highest resolution available matched the true aspect of the monitor. It would make sense to me that the highest resolution of a given monitor matched it's true aspect ratio.

Interesting, i hope more people will confirm this "coincidence".

Karadoc ~~
Member #2,749
September 2002
avatar

I'd be very surprised if anyone had an LCD monitor whose highest resolution did not match the aspect ratio of the monitor. But for CRT monitors, I wouldn't be as confident.

-----------

Oscar Giner
Member #2,207
April 2002
avatar

That doesn't work for CRT :P Mine is 4:3 and its maximum suported resolution is 1440x900, tough if I look at the highest heigh, the it's 1400x1050, which is 4:3

Trent Gamblin
Member #261
April 2000
avatar

Johan Halmén said:

No problem. Check how people look at wide screen TV:s when the broadcasted image is 4:3. They stretch it and seem to have no problem with it. You may think it looks funny (I do!) but most people don't. They are so happy with their wide screen.

My laptop is widescreen, and I have no problem with 4:3 aspect ratio. It looked a little funny at first, but I don't even notice it anymore.

 1   2 


Go to: