[fpc-pascal]Graph Modes Win

Jonas Maebe jonas at zeus.rug.ac.be
Mon May 27 09:13:23 CEST 2002


On Sun, 26 May 2002, Andreas K. Foerster wrote:

> I had a look into the source code of the Graph unit for Windows.
> As I understand it, it supports only 16 or 256 colour modes.
> But internally it seems to map it to rgb colors.

I think currently it even only supports 640x480x16.

> So why doesn't it directly support any truecolor or hicolour modes?
> I would need that.

Florian implemented the Windows graphics unit only to be able to eaily
port standard TP graph programs. Afaik it's also quite different to create
a 256 or higher color screen under Win32 than the 640x480x16 color one,
though I'm not sure of that.

> Do I see it right, that changing the palette doesn't affect already
> drawn pixels?

It's quite possible that the palette functinos aren't supported in the
graphics functinoality of Windows that the graph unit uses. Ideally, it
would be rewritten to use directx, but that's a lot of work...

> So could I make a workaround like this: setting the colour in the palette
> only for drawing one pixel and then changing the same palette entry and
> use it for the next pixel?

Maybe, but if the above wre fixed one day (e.g. by switching to directx),
your program again wouldn't work anymore.


Jonas





More information about the fpc-pascal mailing list