[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] float positions
- From: Elias Pschernig <elias@xxxxxxxxxx>
- Date: Mon, 22 Jan 2007 22:21:45 +0100
On Mon, 2007-01-22 at 17:44 -0300, Victor wrote:
>
> If you (or someone/something else) just cut away the fractional part
> (or round it), so it will be very pointless to transform everything in
> float. Letting the drivers decide what to do with the fractional part
> doesn't seems to be a good idea because that will create trouble for
> people which would use non-integer pixel positions because they need to
> pay attention about if the driver will or will not accept the
> fractional part.
True, that's an argument. My only use case was the case when I require
OpenGL anyway - but if someone makes a game which should work with and
without OpenGL, then it will of course look different in the non-GL
version with fractional pixels cut away.
> However we could implement putpixel (by hand, without OpenGL) with
> something like this:
>
> void putpixel_f(BITMAP *bmp, int color, float x, float y) {
[..]
>
> Warning: Untested, i writted that exactly now.
> That would/should putpixel in fractional positions, so something like
> putpixel_f(bmp, color, 5.75, 6.8) would put 5% of the pixel in (5, 6),
> 15% in (6, 6), 20% in (5, 7) and 60% in (6, 7), blending with the
> pixels already there.
> Of course, that is horribly slow. It may be optimized to something
> faster, but it will still be very slow if not HW accelerated, OpenGL'd
> or something.
Yes, of course anti-aliasing could also be done for memory bitmaps. So
yes, eitehr integer positions and no anti-aliasing, or anti-aliasing, in
which case there also should be float positions. So this can be extended
to what should happen with rotated/scaled blits. Do we want the OpenGL
drivers to always use only GL_NEAREST in that case as well?
> Doing things step by step is still much better.
>
Yes, my first attempts consisted of trying to merge in AllegroGL step by
step.. but it never worked out. So my conclusion was, this is one thing
that can't be done step by step - instead I did it the opposite way and
started the xdummy branch (where my vtables started out with float
positions.. that's when I stumbled on them earlier today when I started
cleaning that branch a bit).
--
Elias Pschernig