[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Palette setting?



[this is 'getting' a bit off topic... :) ] 
> > would make sense to use VDI in W as well, as that means it would work
> > on all machines/graphicscards, and with hardware-acceleration etc. for
> > those that have such things.
> I would strongly recommend this. On machines with PCI graphics cards, you
> won't get much performance when bypassing the VDI (except if you write your
> own driver which uses the accelerator on the graphics card), because reading
> from video ram is painfully slow on these cards.

I made some points regarding implemention of this in an earlier post.

Reading from video memory can be avoided by compiling the server with
REFRESH option defined.  Then server will draw always to the window
backup bitmaps and then blit window contents to screen when necessary.
As default, contents of top windows are drawn straight to screen and
copied from there to their backups when necessary.


Btw.  I just checked my old 'ST Internals' to see how I could set colors
on ST.  Following seems to work under STonX emulation, but I would like
to know how generic this is?  Does it work also on all TT/Falcon/whatever
resolutions having either ST style interleaved bitmaps or 8-bit chunky
bitmaps?

        #include <osbind.h>
        /* ST palette entries use only 3 bits per color component */
        rgb  = (int)(colTab->red[index]   >> 5) << 8;
        rgb |= (int)(colTab->green[index] >> 5) << 4;
        rgb |= (int)(colTab->blue[index]  >> 5);
        Setcolor(index, rgb);

where 'index' is in range of 0 -> (1 << screen_planes).


	- Eero