Monkey
Still Fresh
I've been trying to compile a simple piece of code for my GP2x for the past few days and I've been going round and round in circles. I've followed all the instructions for setting everything up in the gp2x user guide, and it will compile the demo from the wiki but won't run my own code. This is my code:
Heres the makefile:
All I get doing this is a black screen with the cursor in the top left corner :huh:
I've thrown my files all up onto my uni webspace, here.
I'm pulling my hair out over this as I'm planning to do my final year uni project on it, but it won't even display a bitmap for me :blink:.
Code:
#include "SDL.h"
#include "gpmain.h"
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240
#define SCREEN_DEPTH 16
int main(int argc, char *argv[]) {
SDL_Surface *screen, *bmp;
SDL_Rect targetarea;
SDL_Init(SDL_INIT_VIDEO);
screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_DEPTH, SDL_SWSURFACE);
bmp = SDL_LoadBMP("imagetest.bmp");
targetarea.x = 1;
targetarea.y = 1;
targetarea.w = bmp->w;
targetarea.h = bmp->h;
SDL_BlitSurface(bmp, &targetarea, screen, &targetarea);
SDL_Flip(screen);
while(1);
}
Heres the makefile:
Code:
CROSS_COMPILE = C:/devkitGP2X/bin/arm-linux-
SDL_BASE = C:/devkitGP2X/bin/arm-linux-
LDFLAGS = -static
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
STRIP = $(CROSS_COMPILE)strip
CFLAGS = `$(SDL_BASE)sdl-config --cflags` -O2 -Wall -Werror
CXXFLAGS = `$(SDL_BASE)sdl-config --cflags` -O2 -Wall -Werror
LIBS = `$(SDL_BASE)sdl-config --libs`
SDLTEST_TARGET = test.gpe
SDLTEST_OBJS = main.o
all : $(SDLTEST_TARGET)
$(SDLTEST_TARGET) : $(SDLTEST_OBJS)
$(CXX) $(LDFLAGS) -o $(SDLTEST_TARGET) $(SDLTEST_OBJS) $(LIBS)
$(STRIP) $(SDLTEST_TARGET)
clean:
rm -f $(ALL_TARGETS) *.o *~
All I get doing this is a black screen with the cursor in the top left corner :huh:
I've thrown my files all up onto my uni webspace, here.
I'm pulling my hair out over this as I'm planning to do my final year uni project on it, but it won't even display a bitmap for me :blink:.