| View previous topic :: View next topic |
| Author |
Message |
mrlinx
Joined: 20 Mar 2008 Posts: 9
|
Posted: Wed Apr 02, 2008 7:50 am Post subject: Minimal Setup to Show NetDialog/OSK |
|
|
Hi.
I've searched, but came out empty.
What's the minimum setup required to show NetDialog and/or OSK dialogs?
I've removed the cube drawing from the netdialog sample, and replaced it with some clear buffer code. The pool loop stays as:
| Code: |
while(running)
{
sceGuClearColor(0xff554433);
sceGuClearDepth(0);
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
switch(sceUtilityNetconfGetStatus())
{
case PSP_UTILITY_DIALOG_NONE:
break;
case PSP_UTILITY_DIALOG_VISIBLE:
sceUtilityNetconfUpdate(1);
break;
case PSP_UTILITY_DIALOG_QUIT:
sceUtilityNetconfShutdownStart();
break;
case PSP_UTILITY_DIALOG_FINISHED:
done = 1;
break;
default:
break;
}
sceDisplayWaitVblankStart();
sceGuSwapBuffers();
if(done)
break;
}
|
But still, the dialog is showing with lots of flicker, and the buffers dont seem to be clearing.
I don't really know how sceUtilityNetconfInitStart works, but If it starts another thread to make and draw the dialog, Is possible this new thread is drawing faster than my own and thus the flicker? |
|
| Back to top |
|
 |
mrlinx
Joined: 20 Mar 2008 Posts: 9
|
Posted: Wed Apr 02, 2008 9:08 am Post subject: |
|
|
Solved.
I've basicly just added an minimal render code (the step to add directly in to the list seems crutial):
| Code: |
sceGuStart(GU_DIRECT, list);
sceGuClearColor(0xff000000);
sceGuClearDepth(0);
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
sceGuFinish();
sceGuSync(0,0);
|
I still don't understand much about how these dialogs work, but Its working now. |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Wed Apr 02, 2008 10:14 am Post subject: |
|
|
You always need to call sceGuFinish() and sceGuSync() before updating the dialog in any way.
The utility dialogs save the current context, do there thing and then restore the context. |
|
| Back to top |
|
 |
mrlinx
Joined: 20 Mar 2008 Posts: 9
|
Posted: Thu Apr 03, 2008 9:16 am Post subject: |
|
|
Thanks for your answer.
Unfortunately, it still isn't drawing 100%... Sound impressive, but it only draws half of the screen right...
My code right now is:
| Code: |
pspUtilityNetconfData data;
memset(&data, 0, sizeof(data));
data.base.size = sizeof(data);
data.base.language = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH;
data.base.buttonSwap = PSP_UTILITY_ACCEPT_CROSS;
data.base.graphicsThread = 17;
data.base.accessThread = 19;
data.base.fontThread = 18;
data.base.soundThread = 16;
data.action = PSP_NETCONF_ACTION_CONNECTAP;
struct pspUtilityNetconfAdhoc adhocparam;
memset(&adhocparam, 0, sizeof(adhocparam));
data.adhocparam = &adhocparam;
sceUtilityNetconfInitStart(&data);
while(running)
{
sceGuStart(GU_DIRECT, list);
sceGuClearColor(0xff000000);
sceGuClearDepth(0);
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
sceGuFinish();
sceGuSync(0,0);
switch(sceUtilityNetconfGetStatus())
{
case PSP_UTILITY_DIALOG_NONE:
break;
case PSP_UTILITY_DIALOG_VISIBLE:
sceUtilityNetconfUpdate(1);
break;
case PSP_UTILITY_DIALOG_QUIT:
sceUtilityNetconfShutdownStart();
break;
case PSP_UTILITY_DIALOG_FINISHED:
done = 1;
break;
default:
break;
}
sceDisplayWaitVblankStart();
sceGuSwapBuffers();
if(done)
break;
}
|
Can someone point me in the right direction? |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Apr 03, 2008 11:23 am Post subject: |
|
|
| Look at working code, then try commenting out portions until it quits working. At that point, you have a minimal setup. :) |
|
| Back to top |
|
 |
mrlinx
Joined: 20 Mar 2008 Posts: 9
|
Posted: Thu Apr 03, 2008 11:32 am Post subject: |
|
|
That's precisely what I've done.
Unfortunately, seems like removing a more larger renderization process to a smaller, makes the flicker happen. I would appreciate some know how about the dialog rendering, because I think this is a matter of syncing the render with my own render code.
Off course, I might just be wrong. |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Apr 03, 2008 12:40 pm Post subject: |
|
|
| I imagine the dialogs are mostly all the same. You could look at the rendering Doom for the PSP does for the OSK. There's also a PSP Dialog Library - pspdlg1.zip. That does the regular PSP dialogs, so I guess whatever it does is probably the minimum needed. |
|
| Back to top |
|
 |
|