gpRender Rastports Layers and setting a BackFillHook
Posted: Mon Mar 16, 2015 5:46 pm
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:
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.
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);
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.