Screen buffers for game programming

Discuss PocketC for CE (including Desktop Edition)

Postby MarzAstral on Tue Dec 31, 2002 5:55 am

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.
MarzAstral
 
Posts: 8
Joined: Mon Sep 23, 2002 4:54 pm
Location: USA

Postby guy on Tue Dec 31, 2002 7:47 am

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.


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests

cron