Re: [AD] Z-buffer API

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Hello,
> In the new z-buffer API, you initialize z-buffering by
> doing:
>
>    create_zbuffer(bmp);
>
> This sets up a global zbuffer which is private to
> Allegro, ie. the user of Allegro can't access it.
> Wouldn't it be better if you had to do:
>
>    ZBUFFER *zbuf;
>    zbuf = create_zbuffer(bmp);
>    set_zbuffer(zbuf);
>
> ? The difference is that you can have several
> z-buffers around at the same time. This gives more
> freedom to the programmer, and could be much more
> efficient for people who use more than one z-buffer
> (eg in a split-screen game). AFAICS the changes would
> be easy to do, and I'd be happy to code it if everyone
> agrees. (I thought I'd better mention this before the
> API freezes at 3.9.34.)
Seems sensible to me, but the one who knows better how zbuffer works
is his own implementator, and so i think the one who can better answer you

> Also, the current code does
> the assumption that sizeof(int) == sizeof(float)
> (since the z-buffer is stored in a 32 bit bitmap); is
> this true on all platforms?
AFAIK only in the 32bit platforms (well, almost all of the today available
if we let out Turbo C++ 3.01 ;). but anyway, if it's using floats, i see
more sensible to use sizeof(float)... if it uses ints, sizeof(int).. (i
don't know very well about which part of the code you are talking about)



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/