PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Screen image to and from memory buffer

Hi,

I'm new to PocketFrog and just wonder if I can :

1. Save the screen to a memory buffer and then,
2. Load this buffer back on the screen.

It would be most helpful if you can show me how to do it.

Nightcat
You need to create a rasterizer (or use the display's one) to blit to your surface:

1) Create the surface you want to blit to
2) display->SetRenderTarget( your surface );
3) Blit the backbuffer to it with display->Blit( backbuffer );
4) Restore the rasterizer to the backbuffer (display->SetRenderTarget(0)

To bring back your saved copy to the screen, and assuming your render target is back to the backbuffer, a simply display->Blit( your surface ) will do.

Let me know if anything isn't clear to you.