Welcome, Guest. Please login or register.

Author Topic: SetAPen(RastPort*, UBYTE);  (Read 4300 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: SetAPen(RastPort*, UBYTE);
« on: April 06, 2010, 01:02:47 PM »
Quote from: xeron;551664
If you're targetting OS4:

IGraphics->SetRPAttrs( rastport, RPATTR_APenColor, 0xRRGGBB, TAG_DONE );
And if you were targetting AROS/MorphOS you would use:

SetRPAttrs( rastport, RPTAG_FgColor, 0xRRGGBB, TAG_DONE );

At least MorphOS defaults to 3.x pens though, so before using truecolor rendering you should call SetRPAttrs( rastport, RPTAG_PenMode, FALSE, TAG_DONE );. That tells MorphOS that you really want to render by using RGB rather than pens. I don't remember if AROS had such "pen mode" default or not.

Anyway, if AROS graphicslibrary would be backported you'd get the RPTAG_FgColor and RPTAG_BgColor similar to AROS/MorphOS.

Here's some example code I wrote some time ago: http://www.sintonen.fi/src/misc/truecolortest.c
« Last Edit: April 06, 2010, 01:05:02 PM by Piru »
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: SetAPen(RastPort*, UBYTE);
« Reply #1 on: April 06, 2010, 01:10:59 PM »
Quote from: xeron;551690
@Piru
There is no "mode" on OS4, or at least the mode is transparent. If you set "APenColor" APen is an RGB colour value. If you then use SetAPen(), its a pen again.
Well I hope there at least is some way to get and set the mode somehow? Else it'd be a bit messy to write library code that does some rendering using specific mode while restoring the old mode afterwards.