Is Widescreen or not?

Hi,

is there a possibility to find out if the current resolution used by the
user is a widescreen (16:9 or 16:10) or a normal (4:3) resolution.
The problem is that the graphics for my game are set to a resolution of
800x600. Now I must check if the user has a widescreen display, so that
I could add some spacing to the left and right border.

Greets
Christoph

P.S. Sry for my bad english. I am from Germany
-------------- next part --------------
A non-text attachment was scrubbed…
Name: seija.vcf
Type: text/x-vcard
Size: 139 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090105/e2497747/attachment.vcf

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

SDL_GetVideoInfo() returns a struct that has the current_w and current_h
parameters with the desktop resolution. You should call it before
calling SDL_SetVideoMode().

http://www.libsdl.org/cgi/docwiki.cgi/SDL_VideoInfo

Edgar

Christoph Friedrich wrote:

Hi,

is there a possibility to find out if the current resolution used by the
user is a widescreen (16:9 or 16:10) or a normal (4:3) resolution.
The problem is that the graphics for my game are set to a resolution of
800x600. Now I must check if the user has a widescreen display, so that
I could add some spacing to the left and right border.

Greets
Christoph

P.S. Sry for my bad english. I am from Germany



SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkliL3kACgkQolm4VNX3QTx51ACeLlWpWwH380c7SRafWB55gXCs
kLMAoN/U80GHwg43vVsiIZ3Uzei+8xrE
=A9iw
-----END PGP SIGNATURE-----

Hi,

is there a possibility to find out if the current resolution used by the
user is a widescreen (16:9 or 16:10) or a normal (4:3) resolution.
The problem is that the graphics for my game are set to a resolution of
800x600. Now I must check if the user has a widescreen display, so that
I could add some spacing to the left and right border.

If you’re using SDL 1.3, you can use SDL_GetDesktopDisplayMode()

See ya,
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

is there a possibility to find out if the current resolution used by the
user is a widescreen (16:9 or 16:10) or a normal (4:3) resolution.
The problem is that the graphics for my game are set to a resolution of
800x600. Now I must check if the user has a widescreen display, so that
I could add some spacing to the left and right border.

BTW, SDL will automatically do this for you if you request an 800x600 mode
and the smallest available mode is larger than that.

See ya!
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Monday 05 of January 2009 16:21:00 Sam Lantinga napisa?(a):

is there a possibility to find out if the current resolution used by the
user is a widescreen (16:9 or 16:10) or a normal (4:3) resolution.
The problem is that the graphics for my game are set to a resolution of
800x600. Now I must check if the user has a widescreen display, so that
I could add some spacing to the left and right border.

BTW, SDL will automatically do this for you if you request an 800x600 mode
and the smallest available mode is larger than that.

See ya!
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Great! It’s very important for drawed 2d games.–
Regards,
Dominik Dagiel
@Dominik_Dagiel
www.dagiel.pl

What about 800x600 is available, but you’re using a widescreen
display? Currently (in SDL 1.2), this opens the 800x600 mode and
stretches the image. What I’d like is a way to say ‘open 800x600 and
keep aspect ratio’. If we keep the aspect ratio correct, then it
should actually open on a screen of (perhaps) 1200x800 or 1200x960,
depending on the actual aspect ratio of the display.

Basically, I’d like a way of opening a window in a fullscreen display
such that the image isn’t stretched, but centered with the correct
aspect ratio, and clipped to that region. Right now in my current
projects I keep an explicit modelist internally, and take
responsibility for centering the image. But this has several
disadvantages compared to SDL handling it directly:

  1. extra code required
  2. mouse coordinates are no longer (0,0) at the origin of the image
  3. surface->pixels[0] no longer points to the (0,0) origin of the image

Thanks,
SAOn January 5, 2009 01:05:00 pm Dominik Dagiel wrote:

Monday 05 of January 2009 16:21:00 Sam Lantinga napisa?(a):

is there a possibility to find out if the current resolution used
by the user is a widescreen (16:9 or 16:10) or a normal (4:3)
resolution. The problem is that the graphics for my game are set
to a resolution of 800x600. Now I must check if the user has a
widescreen display, so that I could add some spacing to the left
and right border.

BTW, SDL will automatically do this for you if you request an
800x600 mode and the smallest available mode is larger than that.

See ya!
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Great! It’s very important for drawed 2d games.

you should never have to add black bars. its a bug in the display,
grapchics card, or graphics driver if it doesnt scale correctly.

i have seen the problem here. when i was using an ati card the graphics
card scaled correctly, but the dell lcd i have is buggy, i have to mess
with the settings and select scale ( kinda dumb? but fixable)

i have an nvidia ( cant wait to get an ati again, soon as their drivers
work) and that took longer to figure out. there is some option to fix in
the driver (again, really dumb, but somewhat fix able). it did fix one
game i was playing, but not console yet, wondering if i need a reboot. ( i
never reboot )

you shouldnt have to add black bars to fix broken displays or graphics
cards.

mattOn Mon, 5 Jan 2009, Christoph Friedrich wrote:

Hi,

is there a possibility to find out if the current resolution used by the user
is a widescreen (16:9 or 16:10) or a normal (4:3) resolution.
The problem is that the graphics for my game are set to a resolution of
800x600. Now I must check if the user has a widescreen display, so that I
could add some spacing to the left and right border.

Greets
Christoph

P.S. Sry for my bad english. I am from Germany

you should never have to add black bars. its a bug in the display,
grapchics card, or graphics driver if it doesnt scale correctly.

The problem is that someone would like to get a specific aspect ratio
of the pixels (usually 1:1), and putting 800x600 on a 16:10
widescreen display gives you 6:5 pixels (because they are now slightly
stretched out horizontally). So now, people look fat in videos,
circles are ovals, and squares are rectangles, that’s no good.

You have to be able to specify both the resolution and the aspect
ratio (of either the pixels or the display), or at the very least, be
able to know what one is (usually the aspect ratio) so you can set the
other correctly (or compensate for it, by making your squares 120x100
pixels, say).

But very few APIs will tell you the aspect ratio, so the best you can
do is expect that on a computer, the pixel aspect ratio is usually 1:1
(I think that’s more or less always the case on LCDs nowadays, it only
was an issue for some people using SXGA (which is for a 5:4 LCD panel)
on 4:3 CRTs, for some unfathomable reasons), and if you ask for
800x600 on a 16:10 LCD panel, that will require some black bars. If
you have a way of knowing that the display is 16:10, then you can ask
for 960x600 instead and fill the whole screen without bars.

For a game expecting square pixels, 800x600 without black bars on an
16:10 display would be distorted, which some could also call broken.On Mon, Jan 5, 2009 at 3:13 PM, wrote:


http://pphaneuf.livejournal.com/

No, actually this is a “feature.”

Don’t worry, I disagree with such a positive description of this
behavior, too. Nevertheless, there are unfortunately a lot of
consumers out there who prefer (erroneously :wink: that their display
feels “entirely used” as opposed to maintaining a proper aspect ratio.
In fact it’s beginning to have a noticeable neurological affect on
many populations: the ability of test subjects to correctly identify
horizontal stretching in images and videos is diminishing (you can
probably find some studies via Google.)

In fact if you’ve watched TNT (I recently made the mistake of having
cable for a short while… shudder) they regularly process their
picture with a non-linear stretch which is really inappropriate for
a signal source (the processing is meant to be used by people sitting
very close to very large screens, or projecting an image onto a warped
surface, to create a more immersive experience.)

I totally agree that it’s disgusting, but media companies across the
board are pushing it because by various convoluted routes, it
increases their profits: For example, if by putting more stretched
images out there you diminish the public’s ability to find stretched
images distasteful, then you gradually favor people who will choose a
stretched image over black bars. Favoring people who choose stretched
images means more signal sources will choose stretching over black
bars, too. And wide screens are cheaper to manufacture, and appear to
be worth more, to more and more consumers. TERRIFYING BUT TRUE

So yeah, it’s not a “bug,” it’s a “feature.” Arcade gamers will be the
last group clinging to the insistence that our aspect ratios be
correct long after everyone else has either “upgraded” to real wide
screen pictures, or settled for a stretched image.On Mon, Jan 5, 2009 at 3:13 PM, wrote:

you should never have to add black bars. its a bug in the display,
grapchics card, or graphics driver if it doesnt scale correctly.


http://codebad.com/

So yeah, it’s not a “bug,” it’s a “feature.” Arcade gamers will be the
last group clinging to the insistence that our aspect ratios be
correct long after everyone else has either “upgraded” to real wide
screen pictures, or settled for a stretched image.

Real wide screen seems like an actual improvement to me (wider field
of vision in FPS games, for example, which a bit closer to what we
actually see), but stretching is really awful. And if you’ve got an
arcade emulator with a wide screen, the One True Way ™ is to have
pillarboxes on the sides, to get the proper aspect ratio. :-)On Mon, Jan 5, 2009 at 4:44 PM, Donny Viszneki <donny.viszneki at gmail.com> wrote:


http://pphaneuf.livejournal.com/

you should never have to add black bars. its a bug in the display,
grapchics card, or graphics driver if it doesnt scale correctly.

No, actually this is a “feature.”

dont see how. its a bug. its a hazard. its annoying. i have never
tolerated stretched or incorrect aspect ratio, and never will. and with
the crap on tv lately, i have quit watching anyway. movies still look
good here on dvd :)On Mon, 5 Jan 2009, Donny Viszneki wrote:

On Mon, Jan 5, 2009 at 3:13 PM, <@matt_hull> wrote:

Real wide screen seems like an actual improvement to me (wider field
of vision in FPS games, for example, which a bit closer to what we
actually see), but stretching is really awful. And if you’ve got an
arcade emulator with a wide screen, the One True Way ™ is to have
pillarboxes on the sides, to get the proper aspect ratio. :slight_smile:

I don’t totally disagree with that. There’s a reason felines have
vertical slits for pupils instead of horizontal slits, and by the same
token t’s not at all surprising that there are more entertainment
applications for wide screens than tall screens. But as a programmer
who doesn’t program in Chinese, I value how many lines of code can be
oriented top-to-bottom on my screen. (Actually, FWIW, I don’t think
Chinese programmers do view code the same way they view more
traditional Chinese. In fact I believe most of them program in western
character sets.) Luckily I own a pivoting display :wink:

you should never have to add black bars. its a bug in the display,
grapchics card, or graphics driver if it doesnt scale correctly.

No, actually this is a “feature.”

dont see how.

Then you should have read past the part of my email you quoted. Many
companies deliberately choose for their displays and display-related
hardware to “fully utilize” your screen real-estate, rather than
subject the user to “black bars.” Again, I prefer black bars, like
everyone else here, but there are a lot of dumb people out there
buying this shit who prefer the picture stretched, even if they don’t
realize what it is about it that they prefer, and even if they’d
change their minds once it was explained to them.

its a bug. its a hazard. its annoying. i have never
tolerated stretched or incorrect aspect ratio, and never will. and with
the crap on tv lately, i have quit watching anyway. movies still look good
here on dvd :slight_smile:

I’m right there with you!On Mon, Jan 5, 2009 at 5:16 PM, Pierre Phaneuf wrote:
On Mon, Jan 5, 2009 at 5:57 PM, wrote:

On Mon, 5 Jan 2009, Donny Viszneki wrote:

On Mon, Jan 5, 2009 at 3:13 PM, wrote:


http://codebad.com/

I don’t totally disagree with that. There’s a reason felines have
vertical slits for pupils instead of horizontal slits, and by the same
token t’s not at all surprising that there are more entertainment
applications for wide screens than tall screens. But as a programmer
who doesn’t program in Chinese, I value how many lines of code can be
oriented top-to-bottom on my screen. (Actually, FWIW, I don’t think
Chinese programmers do view code the same way they view more
traditional Chinese. In fact I believe most of them program in western
character sets.) Luckily I own a pivoting display :wink:

I’m an optimist: I think of widescreen monitors as “having extra
monitor on the side” rather than “insufficiently tall for it’s width”.
I’m reading this on a 30" monitor here, and if I were to put that
thing vertically, it’s be utterly ridiculous (the “short edge” is only
a few inches shorter than the “long edge” of a 24"! my terminals are
86 lines tall, with tabs, menus and all). :slight_smile:

Then you should have read past the part of my email you quoted. Many
companies deliberately choose for their displays and display-related
hardware to “fully utilize” your screen real-estate, rather than
subject the user to “black bars.” Again, I prefer black bars, like
everyone else here, but there are a lot of dumb people out there
buying this shit who prefer the picture stretched, even if they don’t
realize what it is about it that they prefer, and even if they’d
change their minds once it was explained to them.

I’d like to point out the awesomeness of the BBC World News, which
broadcasts in 14:9, so that while everyone gets black bars (either to
the side if you have a 16:9 display, or to the bottom if you have
4:3), they’re thinner than usual. If you’re lazy and don’t really want
to make your game flexible in aspect ratio (maybe you’ve got a
background artwork, say), you could steal that trick, and use
something like 880x600, which happens to be midway between 4:3 and
16:10. You’d always have some black bars, but they wouldn’t be too
intrusive… :wink:

But screw this stretching business, that’s non-sense!On Mon, Jan 5, 2009 at 6:50 PM, Donny Viszneki <donny.viszneki at gmail.com> wrote:


http://pphaneuf.livejournal.com/

No, actually this is a “feature.”

dont see how.

Then you should have read past the part of my email you quoted. Many
companies deliberately choose for their displays and display-related
hardware to “fully utilize” your screen real-estate, rather than
subject the user to “black bars.” Again, I prefer black bars, like
everyone else here, but there are a lot of dumb people out there
buying this shit who prefer the picture stretched, even if they don’t
realize what it is about it that they prefer, and even if they’d
change their minds once it was explained to them.

its a bug. its a hazard. its annoying. i have never
tolerated stretched or incorrect aspect ratio, and never will. and with
the crap on tv lately, i have quit watching anyway. movies still look good
here on dvd :slight_smile:

I’m right there with you!

i did read it, just still pissy about stretching :frowning: i have wasted more
time messing with fixing it than its worth. infact i have found it
easier to use mplayer and gentoo/linux than my parents dvd player and
their tv due to stretching.

who would have thought that something so simple as diplaying pixels would
be so messed up.

well… at least we agree :stuck_out_tongue:

matt

I’m an optimist: I think of widescreen monitors as “having extra
monitor on the side” rather than “insufficiently tall for it’s width”.
I’m reading this on a 30" monitor here, and if I were to put that
thing vertically, it’s be utterly ridiculous (the “short edge” is only
a few inches shorter than the “long edge” of a 24"! my terminals are
86 lines tall, with tabs, menus and all). :slight_smile:

Your “widescreen monitor” is only slightly taller than it is wide? Huh?

I’d like to point out the awesomeness of the BBC World News, which
broadcasts in 14:9, so that while everyone gets black bars (either to
the side if you have a 16:9 display, or to the bottom if you have
4:3), they’re thinner than usual. If you’re lazy and don’t really want
to make your game flexible in aspect ratio (maybe you’ve got a
background artwork, say), you could steal that trick, and use
something like 880x600, which happens to be midway between 4:3 and
16:10. You’d always have some black bars, but they wouldn’t be too
intrusive… :wink:

Much more clever than CNN, which when viewed in so-called “high
definition” wide-screen formats, displays two giant non-black bars
that just say “HD” over and over again, like they’re taunting you for
having spent extra money on a display to view a signal that doesn’t
even use it :|On Mon, Jan 5, 2009 at 7:47 PM, Pierre Phaneuf wrote:


http://codebad.com/

Stephen Anthony wrote:

Basically, I’d like a way of opening a window in a fullscreen display
such that the image isn’t stretched, but centered with the correct
aspect ratio, and clipped to that region. Right now in my current
projects I keep an explicit modelist internally, and take
responsibility for centering the image. But this has several
disadvantages compared to SDL handling it directly:

  1. extra code required
  2. mouse coordinates are no longer (0,0) at the origin of the image
  3. surface->pixels[0] no longer points to the (0,0) origin of the image

I’d like to go one step further and completely decouple viewport
resolution from screen resolution. When running a 800x600 game on a
1024x786 LCD display, I want to have both vertical and horizontal bars
to avoid even aspect-ratio-preserving stretching.–
Rainer Deyke

2009/1/5 Stephen Anthony :

Basically, I’d like a way of opening a window in a fullscreen display
such that the image isn’t stretched, but centered with the correct
aspect ratio, and clipped to that region. Right now in my current
projects I keep an explicit modelist internally, and take
responsibility for centering the image. But this has several
disadvantages compared to SDL handling it directly:

  1. extra code required
  2. mouse coordinates are no longer (0,0) at the origin of the image
  3. surface->pixels[0] no longer points to the (0,0) origin of the image

Doesn’t SDL have some sort of “subsurface” function to create an
instance of the surface structure so that any operations with it
operate on a sub-area of the surface it was wrought from?–
http://codebad.com/

I’m an optimist: I think of widescreen monitors as “having extra
monitor on the side” rather than “insufficiently tall for it’s width”.
I’m reading this on a 30" monitor here, and if I were to put that
thing vertically, it’s be utterly ridiculous (the “short edge” is only
a few inches shorter than the “long edge” of a 24"! my terminals are
86 lines tall, with tabs, menus and all). :slight_smile:

Your “widescreen monitor” is only slightly taller than it is wide? Huh?

No, sorry, that wasn’t clear. My co-worker uses a dual widescreen 24"
setup, with one set up vertically, and one horizontally. I use a
single 30" monitor, set up horizontally (it can’t be put on its side
anyway, because of the weight, I suspect!).

My (horizontal) 30" is only 3-4 inches less tall than his vertical
24", is what I’m saying.

Those 30" are just a whole lot of monitor, any way you look at it (and
trust me, when you’re sitting in front, it’s hard not to look at
it!)… ;-)On Tue, Jan 6, 2009 at 2:19 AM, Donny Viszneki <donny.viszneki at gmail.com> wrote:


http://pphaneuf.livejournal.com/

Ah, my bottleneck when coding has not yet become physical extents, but
pixel extents. (That is, I have not yet employed a primary computer
display that could draw the smallest raster font I like to use so
small that I could not read it easily.) I think that your point will
become very relevant the next time I purchase a display!On Tue, Jan 6, 2009 at 3:38 AM, Pierre Phaneuf wrote:

On Tue, Jan 6, 2009 at 2:19 AM, Donny Viszneki <@Donny_Viszneki> wrote:
Those 30" are just a whole lot of monitor, any way you look at it (and
trust me, when you’re sitting in front, it’s hard not to look at
it!)… :wink:


http://codebad.com/

Ah, my bottleneck when coding has not yet become physical extents, but
pixel extents. (That is, I have not yet employed a primary computer
display that could draw the smallest raster font I like to use so
small that I could not read it easily.) I think that your point will
become very relevant the next time I purchase a display!

It’s also something like 2560x1600, which is a fair number of pixels. :slight_smile:

Putting that thing sideway (vertically) would be positively nuts, I’d
be afraid of it tipping over onto me and crushing me to death.On 1/6/09, Donny Viszneki <donny.viszneki at gmail.com> wrote:


http://pphaneuf.livejournal.com/