|
![](/i/fill.gif) |
=?ISO-8859-1?Q?=22J=E9r=F4me_M=2E_Berger=22?= <jeb### [at] free fr> wrote:
> #declare aspect_ratio = 4/3;
> #if (abs (image_width / image_height - aspect_ratio) < 1e-6)
> #warning concat ("Invalid aspect ratio: expected ",
> str (aspect_ratio, 1, 3),
> " got ",
> str (image_width / image_height, 1, 3),
> "\n")
> #end
Fine. But why not do this via an SDL statement? The benefits I see would be:
* No cluttering up of the SDL file with yet another macro construction that
still just does some standard thingy
* Providing an official recommended way to deal with aspect ratio that *really*
makes sense (the current recommendation has drawbacks on its own)
* Allowing for additional improvements, like:
- a command line parameter specifying the intended pixel aspect ratio that could
automatically be incorporated into this check (so e.g. specifying an intended
pixel aspect ratio of 2:1 on the command line would suppress the warning when
rendering a 4:3 scene with a resolution of 320x480 pixels) (note that such a
parameter, in turn, could some time become of interest for certain file formats
that natively support pixel aspect ratios other than 1:1)
- providing a shorthand way to set up the camera up/right/direction stuff
Honestly, I see no drawback at all associated with an explicit aspect ratio SDL
parameter. But all existing ways of dealing with aspect ratio *do* have
drawbacks - if only that they're unnecessarily cumbersome.
Post a reply to this message
|
![](/i/fill.gif) |