Skip navigation.
Home
The QNX Community Portal

View topic - PtRaw use

PtRaw use

Isn't the name clear?

PtRaw use

Postby yannbole » Thu Oct 09, 2003 2:56 pm

I use a library which can provide to client some image. It's a generic library i used before on Windows/WinCE on MFC:
. Client had to provide offscreen informations;
. Then, the library filled the offscreen buffer;
. Then, client had only to display it.

I find in Photon Help corresponding features, based upon PgGetVideoMode, PgGetVideoModeInfo, but it implies to use PdSetTargetDevice before:
. I use PhDCGetCurrent() as drawContext as first parameter;
. I use PtWidgetRid(widget) as region ID (2nd parameter).

I do all above treatment in Draw callback of a PtRaw object and PgGetVideoMode failed always.

So, I can't set offscreen parameters as well.

Heeeeeeeeeeeellllllllllllllp !
yannbole
Active Member
 
Posts: 13
Joined: Thu Oct 09, 2003 2:39 pm

Postby yannbole » Fri Oct 10, 2003 10:01 am

To sum up my problem, here's the corresponding code below:
. On a Widget PtRaw;
. Draw function :

void Draw(PtWidget_t * widget, PhTile_t *damage) {
PgDisplaySettings_t *lpDisplaySettings=NULL;
PhDrawContext_t *lpPhDrawContext=PhDCGetCurrent(); //not NULL OK
PdSetTargetDevice(lpPhDrawContext, PtWidgetRid(widget));
PgGetVideoMode(lpDisplaySettings); //return error : why !
}
yannbole
Active Member
 
Posts: 13
Joined: Thu Oct 09, 2003 2:39 pm

Postby evanh » Fri Oct 10, 2003 12:00 pm

evanh
QNX Master
 
Posts: 737
Joined: Sat Feb 01, 2003 8:04 am

Postby yannbole » Fri Oct 10, 2003 4:14 pm

Thanks, i tried it:
. I can reproduce the example on a widget create just like precised, with the 3 proposed solutions;
. If I replace the widget created such as below ...

// initialize our connection to Photon, and create/realize a window
PtInit("/dev/photon");
PtSetArg(&args[0],Pt_ARG_POS,&pos,0);
PtSetArg(&args[1],Pt_ARG_DIM,&dim,0);
win=PtCreateWidget(PtWindow,Pt_NO_PARENT,2,args);
PtRealizeWidget(win);

... by the one I want to fill with test buffer, it doesn't work !
Nothing is displayed in the widget area. The widget used is a scare PtRaw widget, with same dimensions as the example's one (256x256).
There's no crash for the 3 solutions, but nothing is displayed ...

Could you help me, please ?
yannbole
Active Member
 
Posts: 13
Joined: Thu Oct 09, 2003 2:39 pm

Postby cdm » Sun Oct 12, 2003 4:37 pm

How are you driving the main event processing loop?
cdm
QNX Master
 
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am

Postby yannbole » Mon Oct 13, 2003 6:19 am

Excuse me but I'm just a beginner on Photon : perhaps, I'm asking some obvious questions ...
I've not taken into account any main event processing loop problem ...
I have created a "Plain" project with several widget included. The only handly code added, is implemented in the Draw callback of the PtRaw widget : As I obtain the waited debug printf, this callback is called each time a redraw is needed.
Thanks you for your help !
yannbole
Active Member
 
Posts: 13
Joined: Thu Oct 09, 2003 2:39 pm

Postby yannbole » Mon Oct 13, 2003 9:33 am

Good news :D

I finally found the solution to my problem, when reading http://phscrs.sourceforge.net/phscrse.php ....
I had to set Pt_REGION flag in the widget's Pt_ARG_FLAGS resource and it works ....
Sorry if it's an obvious error ... I'm a beginner on Photon ...
Thx for your help !
yannbole
Active Member
 
Posts: 13
Joined: Thu Oct 09, 2003 2:39 pm


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron