GP2X New To Gp2x Dev, Program Shows Black Screen.


zacaj

void main()
Joined
Apr 3, 2007
Messages
362
Age
29
Location
NY
Website
zacaj.com
Hi,
ive been trying to port a module for iPodlinux.org to the gp2x. Its called engine3D, and its written in ttk. ttk's api is here. The source to the module, along with my version of the source, is here. I've never programmed in SDL or for the GP2X before, so Im no quite sure what im doing. Im using the devkitgp2x, and compiling the code with CODE
C:\devkitGP2X\bin\arm-linux-gcc engine3d.c -o engine3d.gpe -I"C:/devkitGP2X/include" -I"C:/devkitGP2X/include/SDL" -DTARGET_GP2X -O2 -Wall -L"C:/devkitGP2X/lib" -lSDL -lSDL_gfx -lSDL_ttf -lfreetype -lSDL -lz -lSDL_mixer -lvorbisidec -lmikmod -lsmpeg -lSDL -lgcc -lm -lc -lexpat
. I dont know how to make a Makefile, and im not sure which paramiters i need, so I put them all in.

Please help
 
Check the wiki for how to run your program from a terminal, and then you'll get all the output too.

Since it seems like your compiling a single file, I wouldn't worry about makefiles for the time being - just use whatever your happy with, and if that is a batch file then so be it.

The most important thing is to have fun :)
 
Add -static to statically link it - the problem is probably that your program can't find the correct libraries.

It's useful to have a telnet or serial terminal to check what's going on.
 
Thanks! It starts now. Now Ive got to figure out the level code-

Can anyone tell me how to make it keep moving if I hold a button, instead of me having to press it repeatedly?
 
Use variables, like button_left, gets true when the stick is pushed left (SDL_KEYDOWN or SDL_JOYBUTTONDOWN event), false when its released (SDL_KEYUP or SDL_JOYBUTTONUP event).
Easiest way, I think.
The you can just do
CODE
if(button_left)walk_left();end;


Take a look at the Lazyfoo SDL tutorials.
 
Unfortunately SDL lacks simple primitive drawing functions. You can either program your own functions by accessing the surface buffer where the raw pixels are stored or you find someone who already did this for you: http://sdl-draw.sourceforge.net/.
 
Try SDL_gfxPrimitives, it's part of DevKitGP2X, works great :)
 
Back
Top