SDL C++ problem

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
zeGouky
Posts: 2
Joined: Mon Oct 31, 2005 4:09 am

SDL C++ problem

Post by zeGouky »

Hi people,

i'm actually having some problems using the SDL with C++ code.

I have already search the forum and found a topic with a solution :

Code: Select all

extern "C" int SDL_main( int argc, char *argv[] );

int SDL_main( int argc, char *argv[] ) {

but when i run my app on my PSP the screen go black and nothing happen. I have done this small test :

Code: Select all

int SDL_main( int argc, char *argv[] ) {
	int		result;
	result = SDL_Init(	SDL_INIT_VIDEO | 
						SDL_INIT_AUDIO | 
						SDL_INIT_TIMER |
						SDL_INIT_JOYSTICK );

	if( !result ) 
		exit(-1);

	SDL_Quit();

	return 0;
}
The app should init and shutdown right away but the psp is showing black screen and nothing ...

If anyone can help i really appreciate.

Thanks
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post by rinco »

SDL_Init returns -1 on an error or 0 on success.

So you aren't running SDL_quit when you should.
zeGouky
Posts: 2
Joined: Mon Oct 31, 2005 4:09 am

Post by zeGouky »

thanks for the reply,

anyway i found the problem , it was 2~3 problems and also a makefile setting. Everything is running fine but SDL is very slow on the PSP :-/

Thanks
Post Reply