Page 1 of 1

PostPosted: Tue Dec 31, 2002 5:55 am
by MarzAstral
I'de like to know if there is a way to set up screen buffers so that i can draw graphics to an off-screen buffer then copy the off-screen buffer to the screen so i can do game programming.

PostPosted: Tue Dec 31, 2002 7:47 am
by guy
You can't do this with the standard PocketC library, although this does include many drawing functions useful to games programmers.

If you install the Windows CE API interface library then you have two options:

1. If you are programming for the PocketPC then you can use the Microsoft Game API (GAPI). This maps the display into memory. You can allocate memory buffers using the API LocalAlloc() function and then copy data to and from the screen using CEAPI_memcpy() - the standard library memcpy() copies PocketC virtual machine memory. This may not be the fastest option.

2. For all CE machines you can use the GDI functions. These let you create virtual screen buffers (known as device contexts) and you can then blit between them and the screen. This tends to be faster because the blit can be handled in hardware if supported by the device.

The CEAPI interface library is free. You can download it through the link in my sig below.

PocketC CE API interface:
PCForm and CE API forum: