PocketMatrix forums

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

Multiple off-screen surfaces

Is there any way for multiple HDC compatible back buffers to exist simultaneously? I'd like to create several GapiDraw surfaces and blit them to a HDC as appropriate. But this doesn't work:

Code:

HRESULT res;
CGapiDisplay d1;
res = d1.CreateOffscreenDisplay(0, 10, 10); /* This returns success */
CGapiDisplay d2;
res = d2.CreateOffscreenDisplay(0,15,15); /* Returns GDERR_PRIMARYSURFACEALREADYEXISTS */


Of course, I can create regular CGapiSurface's and then blit them to the offscreen display and then blit from there to the HDC, but I'm hoping to avoid that extra blit step. Alternatively, I could just use plain CGapiSurfaces and call getDC() on them directly, but that seems to be quite a bit slower.

Thanks
Basically what you want is to use GapiDraw as a GDI wrapper. I would recommend to keep using GapiDraw's blit functions and only use GDI for the final blit - main reason being that GapiDraw's blit operations are significantly faster than using GDI on a Pocket PC.