GP32 Adding image data to Visual C++


Dave18

Member
Joined
Mar 16, 2003
Messages
352
Age
50
Help.

I've been playing around with making a short program for GP32 in visual C++ and the devkitadv tools.
I can get a sprite moving around the screen, but the sprite is only a black square because I can't work out for the life of me how to import image data into my program.
I've have converted a bitmap into a bin file but how do I bring this into C++ so it can then be passed to GpBitBlt as an argument.
Hopefully it's nice and easy but I'm learning Visual C++ at the same time.

Thanks for any help

Dave.
 
I think its gpfileopen then gpfileread (which sends the data to the buffer)
 
Thanks I'll give that a try.

Would that mean that the program would need to have the image files distributed with it? I was hoping that there was a way to include them into the gbx file.
 
Dave18 you must be pyschic!!!!!! I was going to ask the exact same question.
 
kram,

I know, it seems it should be so easy but when you read the documentation for draw gfx they just refer to lovely variables like IMG_SPRITE without telling you how on earth to create your image as that variable in the first place.

I just get this funny feeling that I'm missing something very obvious!
 
Yes, you can include it in your gxb!!!

you use bmp2bin

then bin2c which will make a .h file (do a search for it on yahoo its about 26k)

#include the .h file you made then

access it using bitblt.

When you have finished you demo or game i wouldnt mind recruit someone for my game, what do you think?
 
I'm currently researching loading files as image files, as it important for large scale projects with a team. I'm nearly there!!! :D
 
There are loads of examples for sprites and such with the proper gamepark dev kit which you can download from gp32.com

-Craig

www.gbax.com
 
Thanks for all the help guys. With your advice I've managed to get it working.
 
Back
Top