gpRender Rastports Layers and setting a BackFillHook

This forum is for general developer support questions.
Post Reply
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

gpRender Rastports Layers and setting a BackFillHook

Post by broadblues »

Part of the project I'm working invloves som e low level BOOPSI work, and I'm a little unsure of correct usage of Ratsport etc.

When rendering inside the GM_RENDER call you recive the gprender message

/* GM_RENDER */
struct gpRender
{
ULONG MethodID;
struct GadgetInfo *gpr_GInfo; /* gadget context */
struct RastPort *gpr_RPort; /* all ready for use */
LONG gpr_Redraw; /* might be a "highlight pass" */
};

which has a Rast Port inside it. gpr_RPort;

But there is also a RastPort within the GagetInfo structure.

which one should I be using?

I have been using the gpr_RPort and all has been working okay but for some more adavanced rendering I want to set a temporary backfill hook, so did the following:

Code: Select all

		oldhook = InstallLayerHook(gpr->gpr_RPort->Layer,icd->icd_TransBackFillHook);
   		
   		if(topedge > ib->Top)
   		{
	   		EraseRect(gpr->gpr_RPort,ib->Left,ib->Top,ib->Left + ib->Width -1 ,topedge -1 );
	   	}
/* snip */

	   	InstallLayerHook(gpr->gpr_RPort->Layer,oldhook);
It didn't appear to work, the EraseRect still filled the erased area with a default grey, whilst I may have made an error in my hook, this made me wonder which RastPort I should be using in this case or should I be using the Layer refrenced in the gadget info structure.

So the question is why might the change of backfill hook not have worked in the gpReender->gp_RPort (has it even got a Layer?) and am I correct in thinking that's the one I should be using.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: gpRender Rastports Layers and setting a BackFillHook

Post by broadblues »

Bah Hook didn't work because I hadn't allocated it :oops: :oops: :oops:

/me slinks away in embarassment....
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 4:06 pm
Location: North Florida, near the Big Bend

Re: gpRender Rastports Layers and setting a BackFillHook

Post by LyleHaze »

correct usage of Ratsport etc.
Is that where the user stores their Mouse?
:)
Post Reply