Welcome, Guest. Please login or register.

Author Topic: colour pens question..  (Read 3834 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: colour pens question..
« on: February 20, 2012, 05:58:44 AM »
Quote from: Minuous;681062
Sorry, I don't understand how this would work...I allocate one pen, draw with it, change the colour via SetRGB32, draw with it...wouldn't the colour of the first pixel(s) already onscreen then be changed?

No.

>8 depth screens are not palette indexed. With depth >8 the palette is only used as lookup table when actually drawing. Thus you can draw every single colour with just 1 pen (you just need to change the palette entry with SetRGB32 before every draw).
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: colour pens question..
« Reply #1 on: February 20, 2012, 07:23:27 AM »
Quote from: Minuous;681076
I replaced the call to WritePixelArray8() with SetRGB32() & WritePixel(); this works but is very slow.

Yeah, there's a lot of overhead when writing single pixels like this.
Quote
Presumably doing efficient >8-bit output would require CGX/P96.

cybergraphics/WritePixelArray can be used to render truecolor gfx. P96 emulates this API.

Quote
That's probably not worth it in the case of this particular program.

Yeah. If it begins to matter then you should use cgx/WPA.