Skip navigation.
Home
The QNX Community Portal

View topic - Some trouble with PhCreateImage & PmMemCreateMC

Some trouble with PhCreateImage & PmMemCreateMC

Isn't the name clear?

Some trouble with PhCreateImage & PmMemCreateMC

Postby Fregl » Tue Oct 21, 2008 12:24 pm

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?
Fregl
Active Member
 
Posts: 41
Joined: Thu Jun 05, 2008 10:43 am
Location: Ukraine

RE: Some trouble with PhCreateImage & PmMemCreateMC

Postby Fregl » Tue Oct 21, 2008 2:42 pm

At least, PhCreateImage return address for created PhImage strcuture, and PmMemCreateMC creates context and return it's address too, but
any Pg operation with context doesn't effect, and PgStart, PgStop, PgFlush doesn't works...
Fregl
Active Member
 
Posts: 41
Joined: Thu Jun 05, 2008 10:43 am
Location: Ukraine


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron