GP32 How Do You Display Bmps


Blah

Wanna Be Programmer
Joined
Dec 18, 2003
Messages
3,253
Age
35
Location
Oregon, USA
Website
Visit site
I'm using devkitadvance with the official gp32 sdk. I need to know how you display bmp files. I want instructions and source code. If somebody has already talked about this, just say so.

The SDK manual is confusing, but I've programmed before. Just need a quick answer of however it is done. I think there's a command for it in the SDK itself, but I don't see it.
 
First, I strongly suggest you to use devkitarm (www.devkit.tk) instead of devkitadv. Second, no, there is no function for displaying a BMP, you either need to convert the image to a header file or write yourself a BMP-reader (pretty simple). I think this has been discussed before, you might want to try the search-function.
 
First, doesn't DEVKITARM cost money? I tried GCC but I couldn't get that to work.
I'm not making anything that's very complex and this is probably going to be the only image in the whole program. What is the easiest way to show an image? Anybody?

EDIT: DEVKITARM is FREE.
 
elektron.ewi.tudelft.nl/~brouwe25/bmp.zip

Here's some code from GPAmp, it should compile with devkitadv + sdk.

Load a bmp like this

SKIMAGE test;
loadBMP("gp:\\test.bmp",&test);

You can draw it like so:

drawImage(screen,&test,0,0);

Make sure you're in 16bit mode though. It can read 24bit and 8bit bmp's, rle and uncompressed. But sometimes it might bug :) Also it doesn't load 4bit bmp's. Also the drawImage routine has no clipping. There's also a drawSubImage that will let you draw only a certain portion of the image, wich should be easy enough to use for clipping, and there's getSubImage wich let's you construct a new SKIMAGE from a portion of another.

Make sure you call GpFatInit before doing any loading, otherwise it will crash. The code isn't beatiful, but it does the job.
 
I'd like any feedback on Inop's code, I tried using it a while ago, but couldn't seem to get the color's right, I converted it to Mirko's SDK back then though, so the problem might reside in there.
 
Turned BMP into a .H file. Works ok.

Tip to people:
Use the official resource tool to convert sound and images to .H files.
I used some other converter and thats where I got my problem.
 
My code works fine, you probably fuxxored it up when converting it to mirko's SDK :)
 
To reiterate:

I didn't use Mirkos SDK. I used GamePark's Official SDK in DevKitAdv, using code straight from the Official GamePark SDK manual. The only problem was a crappy .BMP to .H program that was included with my copy of DevKitAdv. I used GamePark's .Bmp to .H program, and that fixed it.
 
blah: I was replying to tristan's post, not you initial one :)

tristan: if you need help using that code, feel free to ask me about it on #gp32dev on efnet, or just paste it here
 
Blah posted on Oct 25 2004 at 11:47 PM said:
I didn't use Mirkos SDK. I used GamePark's Official SDK in DevKitAdv, using code straight from the Official GamePark SDK manual. The only problem was a crappy .BMP to .H program that was included with my copy of DevKitAdv. I used GamePark's .Bmp to .H program, and that fixed it.

I use GP32Converter.exe to convert 24bit BMPs to .C files. It works fine if you don't forget to resize your BMPs to GamePark SDK's boundaries. That is for 16 bit images all sizes have to be multiples of 8.

And for your info: devkitARM and DevKitAdv are just to different distributions of the GCC compiler. devkitARM has a newer GCC version than DevKitAdv, that's why you should use devkitARM.
 
Last edited by a moderator:
Back
Top