Hi everybody.
Had stuck on such problem:
I need create memory context and Image for doublebuffered drawing.
Well, when i create image and memorycontext in base window callback (on opening)
Image = PhCreateImage(NULL,DockDim.w,DockDim.h,Pg_IMAGE_DIRECT_888,NULL,0,0);
mc = PmMemCreateMC(Image,&DockDim,&tr);
PmMemStart(mc);
PgSetFillColor(Pg_WHITE);
PgDrawIRect(tr.x,tr.y,DockDim.w-1,DockDim.h-1,Pg_DRAW_FILL);
PmMemStop(mc);
PmMemFlush(mc,Image);
PtDamageWidget(Widget);
this works fine… all i need draws correctly, but when i put this piece code on some procedure like
void proc(PhImage_t * Image,PmMemoryContext_t * mc,PtWidget_t * Widget,…)
{
Image = PhCreateImage(NULL,DockDim.w,DockDim.h,Pg_IMAGE_DIRECT_888,NULL,0,0);
mc = PmMemCreateMC(Image,&DockDim,&tr);
PmMemStart(mc);
PgSetFillColor(Pg_WHITE);
PgDrawIRect(tr.x,tr.y,DockDim.w-1,DockDim.h-1,Pg_DRAW_FILL);
PmMemStop(mc);
PmMemFlush(mc,Image);
PtDamageWidget(Widget);
}
nothing draws at widget (PtRaw)…
just gray background and nothing else…
i want use this code on class’s method, but this approach don’t work.
Please say, where i made mistake?