| View previous topic :: View next topic |
| Author |
Message |
loko
Joined: 23 Jul 2005 Posts: 6
|
Posted: Fri Jul 29, 2005 1:28 am Post subject: How to make an ingame screenshot tool ? |
|
|
| How to make an ingame screenshot tool ? How method do I need to use, and simply is that just possible ? |
|
| Back to top |
|
 |
Andon
Joined: 10 Jul 2005 Posts: 15 Location: Florida
|
Posted: Fri Jul 29, 2005 1:56 am Post subject: |
|
|
You need to know the framebuffer pixel format first of all, either 16 or 32-bit (and the order of the color channels), and then it's pretty easy.
Pseudo Code:
| Code: |
#include "pspge.h"
char* frame_buf;
...
frame_buf = (char *) sceGeEdramGetAddr ();
|
Now frame_buf points to the VRAM.
Now, each pixel is either 2 or 4 bytes long, so for a full screenshot (480x272), you'd read (pixel_bytes * 480 * 272) from frame_buf into your own buffer.
You could write this straight to the Memory Stick and use it as is, but normally you'd want to encode it into TGA, PNG, JPG, etc. Depending on your encoder of choice, you may need convert each pixel swapping Blue and Red, range (de)compressing color channels and such before you can even encode it.
Encoding to TGA is fairly trivial and can be done without any library. PNG and JPEG both have PSP ports you can use, look in SVN. I believe there was also a tutorial several months ago on writing to a BMP, search the forum... |
|
| Back to top |
|
 |
Saotome

Joined: 03 Apr 2004 Posts: 182
|
Posted: Fri Jul 29, 2005 4:33 am Post subject: |
|
|
There were already threads on this topic providing even complete source code. I bet if you use the search function you'll find at least two threads. _________________ infj |
|
| Back to top |
|
 |
Agoln

Joined: 08 Jun 2005 Posts: 326 Location: Fort Wayne, IN
|
|
| Back to top |
|
 |
|