• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Pocket PC Bitmap -> VidMem problem... any takers?

## Recommended Posts

Hi y''all. Been working through some code so I can write a game for the PocketPC platform. Basically what I have done is the following: Using the GDI I can display bitmap sprites on the screen and move them around etc no problem at all. Obviously though, the more sprites I have, the slower the frame rate. Now on the Casio E-125 that I have, 10 sprites moving over a background drops the frame rate to about 10fps Now I have written a library of functions to draw directly to the screen using the GAPI interface such that I can draw specific pixels. My theory was then to combine the two as this should be faster.. going down to the hardware level (almost). Digging thru the BITMAP struct it turns out that each pixel is represented by a linear set 3 bytes. The first two containing the 16 bits for the colour and the last one spare for the future. So here''s what I am doing to just try and draw a BG image: //called at the start to get info. int px, py, bWidth, bpp; px = bmBackground.bmWidth; py = bmBackground.bmHeight; bWidth = bmBackground.bmWidthBytes; bpp = bmBackground.bmBitsPixel / 8; unsigned short theColor; unsigned char *pixel = (unsigned char *)bmBackground.bmBits; for (int y=0; y Hang on, where I come from, $0.02 is rounded down. Does that mean my opinion is worthless or priceless? CHROM #### Share this post ##### Link to post ##### Share on other sites harley985 122 I started down this same route and quickly abandoned GAPI once I came across this book. http://www.primagamedev.com/books/book/5008/ I comes with a game library for the Pocket PC and I have already begun writing several little test games. Hope this helps. #### Share this post ##### Link to post ##### Share on other sites harley985 122 I started down this same route and quickly abandoned GAPI once I came across this book. http://www.primagamedev.com/books/book/5008/ It comes with a game library for the Pocket PC and I have already begun writing several little test games. Hope this helps. #### Share this post ##### Link to post ##### Share on other sites Hi Harley, Thanks for that. I have actually been working with the author and we have solved the problem since I posted this, but thanks for the tip. I''ll let Jonathan know that his book is being well received. GAPI is much better than GDI as you can do stuff much faster. I have written a library with all sorts of drawing routines in it. It needs some debugging but I can happily send it to you if you are interested. Cheers, -- And that''s my$0.02 worth --

Hang on, where I come from, \$0.02 is rounded down. Does that mean my opinion is worthless or priceless?

CHROM