[Help/Suggestions needed] MultiTasKing v101
[Help/Suggestions needed] MultiTasKing v101
Hi guys!
I came here a few months ago under the username "usertestprueba" (xD) and thanks to your help I have managed to get this:
http://www.youtube.com/watch?v=jDLfzjE--qg
I just want to know what do you think about it :-)
Please, suggest things, and checkout the prx sources ;-)
Thank you very much for your help.
Cheers,
Carlosgs
I came here a few months ago under the username "usertestprueba" (xD) and thanks to your help I have managed to get this:
http://www.youtube.com/watch?v=jDLfzjE--qg
I just want to know what do you think about it :-)
Please, suggest things, and checkout the prx sources ;-)
Thank you very much for your help.
Cheers,
Carlosgs
Last edited by carl0sgs on Sat Feb 06, 2010 1:21 am, edited 1 time in total.
-
- Posts: 87
- Joined: Thu Oct 01, 2009 8:43 pm
Wow
Hi,
this really looks amazing. You are starting porting Windows onto PSP ?
Good stuff. I hav't seen the source...the result looks nice ;o)
this really looks amazing. You are starting porting Windows onto PSP ?
Good stuff. I hav't seen the source...the result looks nice ;o)
Re: Wow
It is not windows, it is my own window manager :-)anmabagima wrote:Hi,
this really looks amazing. You are starting porting Windows onto PSP ?
Good stuff. I hav't seen the source...the result looks nice ;o)
Thanks for the support ;-)
Re: MultiTasKing v101
Really good. A wonder window manager. How about some widget tools?carl0sgs wrote:Hi guys!
I came here a few months ago under the username "usertestprueba" (xD) and thanks to your help I have managed to get this:
http://www.youtube.com/watch?v=jDLfzjE--qg
I just want to know what do you think about it :-)
Please, suggest things, and checkout the prx sources ;-)
Thank you very much for your help.
Cheers,
Carlosgs
Re: MultiTasKing v101
Thanks! :-)liberty wrote:Really good. A wonder window manager. How about some widget tools?
What do you mean with widget tools?
A library that provides a list of GUI elements (sometimes called 'widgets'), like buttons, checkboxes, textboxes, menus, etc.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl
Hi again!
So I've been thinking about how to implement widgets ;-)
I have the idea, (i've added simple buttons support) and now I just need some speed.
Here is a screenshot:
(The buttons keep count of the times they've been pressed)
I need your help and suggestions:
I want to use OSLib, because it uses the GU (graphics.h is too slow) and it is possible to use intrafont in a fast way, rotate images...
So, my idea is to have in each window a list (doubily linked) with each image, each button... etc, each element of the API.
In the background I'd add just a color.
Then, when refreshing the screen, the program would go through the windows list, and in each window it'd look into the API list, and print all the stuff.
Oh, and the main thing is to use "sceGUscissor" to set the drawing area in each window, limiting everything correctly ;-)
The problem comes when I want to print something into an image, cause OSLib requires the GU (graphics.h uses software only for this, that's why it is slow here).
I have not much experience with OSLib, so some help would be really appreciated.
Thanks a lot :-)
So I've been thinking about how to implement widgets ;-)
I have the idea, (i've added simple buttons support) and now I just need some speed.
Here is a screenshot:
(The buttons keep count of the times they've been pressed)
I need your help and suggestions:
I want to use OSLib, because it uses the GU (graphics.h is too slow) and it is possible to use intrafont in a fast way, rotate images...
So, my idea is to have in each window a list (doubily linked) with each image, each button... etc, each element of the API.
In the background I'd add just a color.
Then, when refreshing the screen, the program would go through the windows list, and in each window it'd look into the API list, and print all the stuff.
Oh, and the main thing is to use "sceGUscissor" to set the drawing area in each window, limiting everything correctly ;-)
The problem comes when I want to print something into an image, cause OSLib requires the GU (graphics.h uses software only for this, that's why it is slow here).
I have not much experience with OSLib, so some help would be really appreciated.
Thanks a lot :-)
-
- Posts: 203
- Joined: Sat Jul 05, 2008 8:03 am
Don't mix gu and mod_osl, do all the stuff with mod_osl
a sample menu choice with image + text
if you use c++ you can do a class per object earch object has a render method
all the object you created are put in a linked list for earch event you put the messageto the object that have subscibe to receive the event. Each object is responsible to
render is image. Look at the code of a old homebrew fileassistant it is what you want
to do and it use gu and not osl ;)
a sample menu choice with image + text
if you use c++ you can do a class per object earch object has a render method
all the object you created are put in a linked list for earch event you put the messageto the object that have subscibe to receive the event. Each object is responsible to
render is image. Look at the code of a old homebrew fileassistant it is what you want
to do and it use gu and not osl ;)
Code: Select all
while (!osl_quit)
{
//Doit on faire le rendu?
if (!skip)
{
oslStartDrawing();
oslDrawImageXY(img, 0 ,0);
oslSetTransparentColor( couleurMasque );
if (num_tableau == 0)
oslDrawImageXY(imgchoix[num_tableau], 90 ,25);
else oslDrawImageXY(imgchoix[num_tableau], 90 ,40);
oslSetBkColor(RGBA(0,0,0,0));
oslSetTextColor(RGB(0, 128, 0));
oslPrintf_xy(180, 13, titre[num_tableau]);
if (tempo == 15)
{
tempo=0;
sav = textinfo[0];
for(i=0;i<strlen(textinfo)-1;i++)
textinfo[i] = textinfo[i+1];
textinfo[i] = sav;
}
else tempo++;
strcpy(text,textinfo);
text[60] = '\0';
oslSetTextColor(RGB(255,0,0));
oslPrintf_xy(20, 250, text);
oslEndFrame();
oslEndDrawing();
}
//Pour pouvoir gérer les touches
oslReadKeys();
if (osl_pad.pressed.cross)
return num_tableau;
if (osl_pad.pressed.circle)
{
num_tableau++;
if (num_tableau == 3)
num_tableau = 0;
}
//Synchro à 60 fps
skip = oslSyncFrameEx(0, 6, 0);
}
return -1;
}
thanks for the source!
but i think i haven't explained myself correctly
the problem is that the sceGU is needed in different threads, and when it is started in one thread you cannot use it from other threads.
This is solved by making objects lists wich are printed all at a time in the screen.
But! what if I need to manipulate images from other threads? shall I add something like a semaphore to avoid starting the GU from different threads?
Any idea?
Thank you for your help!
but i think i haven't explained myself correctly
the problem is that the sceGU is needed in different threads, and when it is started in one thread you cannot use it from other threads.
This is solved by making objects lists wich are printed all at a time in the screen.
But! what if I need to manipulate images from other threads? shall I add something like a semaphore to avoid starting the GU from different threads?
Any idea?
Thank you for your help!
You probably want to split your code up better. Sounds right now like the drawing and updating and input are all mixed together. It would be better if you had a data structure for your windows - for simplicity's sake let's say it was just a linked list of id,x,y,width,height of each window.
Then you have a semaphore which locks access to the list. Any thread wanting to modify a window locks the list, makes the change, and unlocks it again.
You also have a single thread which knows how to draw windows. It also locks the list, draws all the windows in one go, then unlocks the list.
That way you have divided responsibility for update and drawing into separate places and solved the problem of multithreaded gu access.
If the 'big lock' on the list is too 'lumpy' you can work on having a semaphore for each window and a drawing semaphore. Updating a window locks both its own semaphore and the drawing one.
Jim
Then you have a semaphore which locks access to the list. Any thread wanting to modify a window locks the list, makes the change, and unlocks it again.
You also have a single thread which knows how to draw windows. It also locks the list, draws all the windows in one go, then unlocks the list.
That way you have divided responsibility for update and drawing into separate places and solved the problem of multithreaded gu access.
If the 'big lock' on the list is too 'lumpy' you can work on having a semaphore for each window and a drawing semaphore. Updating a window locks both its own semaphore and the drawing one.
Jim
Thanks! Great idea :-P
Right now the windows are structures, so thats not a problem xD
For drawing in the windows I have thought about making "drawing" and "reading" buffers,
two lists with the window's content. (One of them would be printed out in the main "printing" thread, the other one used for drawing things into the window and then, swapping the buffers).
I'm going to learn and practise with semaphores, cause I have no idea right now.
(I've been using variables like "printingWindows = 1" and while(printingWindows == 1) delay(1000); as a kind of semaphore lol)
Thanks again,
Carlos
Right now the windows are structures, so thats not a problem xD
For drawing in the windows I have thought about making "drawing" and "reading" buffers,
two lists with the window's content. (One of them would be printed out in the main "printing" thread, the other one used for drawing things into the window and then, swapping the buffers).
I'm going to learn and practise with semaphores, cause I have no idea right now.
(I've been using variables like "printingWindows = 1" and while(printingWindows == 1) delay(1000); as a kind of semaphore lol)
Thanks again,
Carlos
Yes, actually I would like to make an opensource project about this, but for that I need first to have something stable, the "main structure".
It would be really awesome to have even 3D drawing capabilities in the windows, maybe I'm pointing too high with this ><
I'm thinking a lot about how to make this (well. Right now it is just "usable", i want more ;-)).
I will have time for this in Summer, anyway.
Cheers,
Carlosgs
It would be really awesome to have even 3D drawing capabilities in the windows, maybe I'm pointing too high with this ><
I'm thinking a lot about how to make this (well. Right now it is just "usable", i want more ;-)).
I will have time for this in Summer, anyway.
Cheers,
Carlosgs