Subject: Semi related to netbsd... XFree86, X11 coding question
To: None <port-i386@netbsd.org>
From: Jeff Mitchell <skeezix@skeleton.org>
List: port-i386
Date: 09/22/1998 18:00:00
	Allocating colours in X11 is extremely slow in >8bpp. I'm not sure
if this is limited to the netbsd port, XFree86's XServers, X11 as a whole,
or my chipset in particular. I've got some code which must do colour
fades (like a fade to black), or highspeed animation (in an arcade game). 

	For doing colour fades, life is tough -- in 8bpp of course, you
just change the palette and go, while using a private colourmap. In >8bpp,
in truecolour, you have no such luxury ... so must allocate the colours
you need for the fade's next frame, run through your MITSHM buffer
changing the colour references from the old frame's palette to the new
palette, and ship it off to the XServer. This is fast except for the
colour allocation phase, which is taking a very long time (half a second
on my machine, detailed below). If doing (say) a 200 step fade, one can
see how bored the user would get.

	For realtime animation sake, if a palette change must occur, the
game halts for a moment while the XServer seems to do a nice slow linear
search through the palette looking for the exact match. Noticable jitter.

	I'm trying to work around this, without being too brutal or silly.
Is there anyone with experience doing high speed graphics under X11 handy,
who'd be interestedin swapping ideas? Anyone with any clues for me?

		Jeff

	My setup is NetBSD 1.3/i386, on a P200MMX box, with an ATI Rage2
Pro chipset using XFree86 (from about 6mo ago, version not available this
instant).

--
"It's murder out there. You can't even travel around in your own micro
circuits without permission from 'Master Control Program'. I mean,
sending *ME* down here to play games.... Who does he calculate he is?"
-- Peter Jurasik as Crom, _Tron_