my first PSP code
Hey, I am sorta new a coding for PSP, so I was wondering if someone more experienced could have a look at this code for a PSP Paint app...
Without furthur ado here is my code
EDIT: my link wasnt allowed, so I'll attach it instead :)
EDIT2: the file is too big to attach (334kb)
so ill just have to post the link and hope spambots dont rape my server
P.S. ignore the code::blocks files, i use eclipse now, because i got debugging working on it
Most of the trouble i have been having is with double buffering, as well as some problems with loading the image, which was never a problem before. Ideally i would like to make the images, programatically, but i thought it best to load them as images for now, until i get the double buffering under control.
Another problem is that when the image is displayed for selecting the colour, it overwrites the drawing canvas, so ideally this should be done by making another buffer, to load the image to, maintaining the original canvas, but i dont now how to do this...
some people i spoke to an IRC channel, said the source of all my problems was using the graphic.c library, and recommended another, which i havent been able to get working at all....
Anyways, I would appreciate an explaination of a solution, rather than just it done for me :)
Supported your link, and good work. :)
I hate to bump my own thread, but....
Is there anyone here that can help me, maybe I asked this in the wrong forum?
okay, new forum, new day, new hope...
Is there anybody here that could help, or at least point me to someone that could
Please! I have been trying to get this code right for ages now...
Even a link to a tutorial about double buffering or how to use addtional buffers in C/C++ would be extremely helpful
Hey mc_teo, nice to see a fellow Irishman join the psp scene :)
Originally Posted by mc_teo
Send me a pm and I will give you a hand, if I have time ;)
Either i canr seem to find the PM button, or i cant PM since im still new, so ill reply here
My main problem is double buffering, i cant seem to get it to work right
I would prefer a gentle push in the right direction, than someone to do it for me :P
I want to be able in future have multible states, like for pausing and menus, etc, so as far as i see this can be best achieved by creating and maintaining multible buffers in memory
So i guess im looking for help on how best how to do this, but more importantly following on my motto ("Give a man a fish, feed him for a day; Teach a man to fish, feed him for life") i would like a tutorial or similar on how to do this
P.S. Link to source code is in first post
Are you drawing directly to the framebuffer? Or are you using images/surfaces and blitting them to the framebuffer every frame?
I was originally drawing everything to the framebuffer, but after meeting nice chap on IRC, he explained to be all about pointers (which i knew about before, but not what they actually were useful for :P), and then with this newfound knowledge i found i could make my own buffers using the graphics.c Image structure, and draw everything to them, and at the end of my loop/frame memcpy() (or sceGuCopyImage()) them to the original framebuffer, before flipping them...
This way i can use multiple buffers to draw and mess around with, maintain buffers i want to keep, update buffers i want to change, and then still make use of double buffering to stop flickering
I am in the process of rewriting my code from scratch to implement this
Is this how anybody else does it? or would you recommend a different method?
You don't need double buffering for this problem. You just need the canvas to be on a separate image/surface to everything else and blit it to the screen buffer every frame and then blit the overlay menu.