Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-05

Graph Modes Win

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andreas K. Foerster

Hello,

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.

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

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

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?

Tschuess Andreas
Jonas Maebe
to Andreas K. Foerster
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

Rich Pasco
to Jonas Maebe
Jonas Maebe wrote
I think currently it even only supports 640x480x16.

Not so. I use it to draw at 1600x1200 and other screen resolutions. If you want proof, let me know and I can e-mail you a screen capture of such an graph.

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

That makes sense. The Graph unit for Turbo Pascal was written for machines with a hardware palette, where it implemented. Emulating that on a true-color display would be difficult.

- Rich

Florian Klaempfl
to Andreas K. Foerster: I had a look into the source code of the Graph unit for Windows. As I understand it, it…
you wrote 7 lines
Hello, 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. So why doesn't it directly support any truecolor or hicolour modes?

Because nobody implemented it yet.

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

Yes.

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?

Yes.

Jonas Maebe
to Florian Klaempfl
Florian Klaempfl wrote 7 lines
>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. > >So why doesn't it directly support any truecolor or hicolour modes? Because nobody implemented it yet.

Also, truecolor is impossible currently because the "color"/"pixel" type is a 16bit word.

Jonas