Mail Archives: djgpp/1996/04/12/06:39:25
Massimiliano Mantione wrote:
>
> (...)
> private:
> int theHeight;
> int theWidth;
> double *theArray
> double **theArrayRows
>
> public:
> inline double ZBufferElement(int X, int Y)
> { return theArrayRows[X][Y]};
> (...)
>
> and using a constructor that initializes the ``theArrayRows''
> pointers to the correct address of each row in ``theArray''.
>
> With this trivial trick, you would:
> [1] Waste a bit of memory (but not so much, compared to the
> whole ZBuffer).
> [2] malloc only once a great amount of memory, and then
> manage to use it as you like (it was just what Eli was
> telling you).
>
Great ! I'll do this !
Thanks,
Jesus
--
--------------------------------------------------------------------------------
DIGITAL ILLUSION * Grup Matrust
Jesus Canal Trav. de les Corts, 222 * 08028 Barcelona (Spain)
Software Enginner Tel. (34-3) 409 01 15 * Fax (34-3) 409 01 16
mailto:jesus AT matrust DOT es * http://www.matrust.es
--------------------------------------------------------------------------------
- Raw text -