Devc++ "all In One" Does Not A Lot?


acron^

Still Fresh
Joined
Oct 23, 2006
Messages
9
Ok, so I'm absolutely rubbish at Linux and am a total VS2005 fanboi.
After failing horribly to get VS setup for .gpe compiling (yes, I tried the Wiki several times) I gave up and
tried to use the DevC++ 'starter kit' in the official SDK.

Because it's got really nice switching between win/gp2x, I can see what i'm doing as I go along. So, I start with something really simple. A few SDL functions to clear the screen to a colour and wait for an input before quitting. The 'win' version compiles, runs, tada, lovely. I compile a gp2x version, whack it onto my SD card and...black screen :/ It waits nicely for the input before quitting, but that's all it does.

I then tried taking some code from a couple of the demos here on the site. Similar ways of doing the same thing and NONE of them do anything!

Is there some special way to setup DevC++? I'm using F/ware 2.0 - would this make a difference? I just can't think what i'm doing wrong if it's supposed to be as easy as everyone suggests :s

Thanks

UPDATE:
I've just been through this entire tutorial and I get exactly the same result.

When I first got my GP2X, I installed these SDL Libraries - could that have had anything to do with it? Is there any way to default everything on my GP2X? Will upgrading the firmware acheive this?
 
Code:
/* Initialize SDL */
	if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK) < 0) {
		fprintf (stderr, "Couldn't initialize SDL: %s\n", SDL_GetError ());
		exit (1);
	}
	atexit (Terminate);

	SDL_ShowCursor(SDL_DISABLE);

	/* Set 320x240 16-bits video mode */
	screen = SDL_SetVideoMode (320, 240, 16, SDL_SWSURFACE);
	if (screen == NULL) {
		fprintf (stderr, "Couldn't set 320x240x16 video mode: %s\n", SDL_GetError ());
		exit (2);
	}
	
	SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,0,255,0));

The thing is, i've taken code from other demos - like Guyfawkes for example - and it still doesn't work.
I've tried 2 different IDEs now, both with identical results. I'm starting to wonder if these 'SDL Libraries' have some how messed things up :/ But saying that, all my games and Guyfawkes pre-compiled .gpe still works fine! Argh.
 
Since you are using the HW libraries, try changing the following line
Code:
screen = SDL_SetVideoMode (320, 240, 16, SDL_SWSURFACE);
to
Code:
screen = SDL_SetVideoMode (320, 240, 16, SDL_HWSURFACE);

I would also check if you have the data files in the correct place. Also try compiling something you know works 100%.
 
I think that may have done the trick! I've certainly got CodeBlocks working now so i'll just keep my fingers crossed and hope it lasts :D Thanks for your help!
 
I use Code::Blocks too, it's such a great IDE! And using SDL_SWSURFACE with the hardware libs should give you no problems, I use it all the time when working with SDL_gfx primitives.

- Alex
 
Back
Top