Help drawing objects from a prx
Help drawing objects from a prx
i have a main eboot.pbp that does the drawing but i also have prx's that act as sub programs how can i have the prx draw when the main eboot draws to have objects draw
Re: Help drawing objects from a prx
You can use semaphores to coordinate between different executables.
http://www.kernsafe.com/TechDocs/pspsdk ... an_8h.html
Lock the semaphore in the eboot thread. Make the prx wait until the semaphore is released to do its drawing, etc. When the eboot needs to tell the prx to draw, unlock the semaphore.
You create the semaphore in the eboot with a unique name. Then you will need to find the semaphore in the prx to check if its locked. Use sceKernelGetThreadmanIdList to list the semaphores and find the one with the name you want.
If speed is not of importance, you can export a function from the prx, and call it from your eboot thread when you need to tell it when to draw.
http://www.kernsafe.com/TechDocs/pspsdk ... an_8h.html
Lock the semaphore in the eboot thread. Make the prx wait until the semaphore is released to do its drawing, etc. When the eboot needs to tell the prx to draw, unlock the semaphore.
You create the semaphore in the eboot with a unique name. Then you will need to find the semaphore in the prx to check if its locked. Use sceKernelGetThreadmanIdList to list the semaphores and find the one with the name you want.
If speed is not of importance, you can export a function from the prx, and call it from your eboot thread when you need to tell it when to draw.
that not the problem i need to be able to draw from the prx i'm using oslib it crashes when doing so but i think i may send the prx the function pointers to call to draw from because i'm using a drawingcanvas that has a vector of drawings and i cant load images either its the images that have the problem any reason why
It's because a prx cannot (yet) import or export anything other than function pointers. Any reference to ANYTHING used must be passed as an argument to the function called. That makes things like many libc functions unusable as they reference things in the EBOOT implicitly. For example, say you define an int called x in the EBOOT. The prx cannot do "y = x <<8;" as it has no idea what or where "x" is. You'd have to pass &x through to the function and do "y = *passed_x_ptr <<8;" to get around that.