Index: [thread] [date] [subject] [author]
  From: Steven Engelhardt <sengelha@uiuc.edu>
  To  : ggi-develop@eskimo.com
  Date: Sat, 17 Apr 1999 16:53:37 -0500

GGI usage question

Hello,

I've been following GGI for quite a while now, and I would like to say
that I think you guys are doing great work.  Keep it up!

Anyways, to try and learn GGI, I decided to rewrite acidwarp,
especially to get it to work in non-paletted graphics modes.
Currently I have:

ggi_visual_t vis;
ggi_pixel palette[256];  /* This contains the current palette */
ggi_color color[256];    /* The color information from the palette */
int memory[x][y];        /* The current image which contains indexes
                            into palette[] -- for simplicity, treat x and y
														as being 640 and 480 */

To draw the current image, I used the (highly suboptimal) method of:
  int i, j;
	
  for (i = 0; i < graphics->x; i++) {
    for (j = 0; j < graphics->y; j++) {
	    ggiPutPixel(graphics->vis, i, j,
                  graphics->palette[graphics->memory[i][j]]);
    }
  }
			
	ggiFlush(graphics->vis);

While this method gives acceptable performance on my computer in
asynchronous modes (such as windowed X), it is horribly slow in SVGAlib.

Could someone suggest a better method of doing this?

Thank you,
-- 
 Steven D. Engelhardt <sengelha@uiuc.edu>
 http://www.uiuc.edu/ph/www/sengelha

Index: [thread] [date] [subject] [author]