Index:
[thread]
[date]
[subject]
[author]
From: Brian Julin <bri@forcade.calyx.net>
To : ggi-develop@eskimo.com
Date: Sun, 28 Mar 1999 11:24:15 -0500 (EST)
Re: Some more "texturetalk"
On Sun, 28 Mar 1999, Christoph Egger wrote:
> Yes, that's good. Some questions:
>
> 1. When you allocate with ggiAuxBufAlloc memory i.e. for Z-buffer, which
> band-whidth has it? 16bit, 32bit or 64bit?
It could have any -- you'll get a generic db struct back for each similar
set of buffers, and you'll be able to vary the start address or
stride and a few other (extendable) parameters for each of them
using the same db struct, or mix a few db structs in the same grid
of buffers.
> 2. Could I use fixpoint-math, float-point math or both to access to it?
Not sure what you mean. The coordinate translation is a sequence
of bitwise boolean ops and shifts, a couple of adds, and a modulus, like so
(and optimizations of this are welcome):
#define LIBGGIBUFGRID_TRANSXY(vis,tx,ty,slotnum) \
do { \
slotnum = tx >> LIBGGIBUFGRID_BITSX(vis); \
tx &= (int)~((int)~0 << LIBGGIBUFGRID_BITSX(vis)); \
tx += (int)~0 << (LIBGGIBUFGRID_BITSX(vis) - 1); \
slotnum |= (ty >> LIBGGIBUFGRID_BITSY(vis)) << \
((sizeof(int) << 3) - LIBGGIBUFGRID_BITSX(vis)); \
slotnum %= LIBGGIBUFGRID_SLOTS(vis); \
ty &= (int)~((int)~0 << LIBGGIBUFGRID_BITSY(vis)); \
ty += (int)~0 << (LIBGGIBUFGRID_BITSY(vis) - 1); \
} while (0);
So the BufGrid is a grid of buffers aligned on power-of-two
coordinates, with 0,0 represented as the point in the
middle of the grid square (to allow for drawing off the
edge with clipping.) Yeah, I know, I got crazy a little
with the typecasts :).
--
P.C.M.C.I.A. stands for "Plastic Connectors May Crack If Adjusted"
-- me
--
Brian S. Julin
Index:
[thread]
[date]
[subject]
[author]