SDL on Slim?

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

Moderators: cheriff, TyRaNiD

Post Reply
Leo28C
Posts: 19
Joined: Thu Jan 18, 2007 8:20 am

SDL on Slim?

Post by Leo28C »

Greetings,

How do you run an SDL game on the Slim? It ran fine on my Fat... I found this:

http://forums.ps2dev.org/viewtopic.php? ... d3ad90e549

but it says to disable SDL_main, does that mean I can't use SDL? If not, how do I do that?

Thanks in advance,
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Re: SDL on Slim?

Post by Wally »

Leo28C wrote:Greetings,

How do you run an SDL game on the Slim? It ran fine on my Fat... I found this:

http://forums.ps2dev.org/viewtopic.php? ... d3ad90e549

but it says to disable SDL_main, does that mean I can't use SDL? If not, how do I do that?

Thanks in advance,
YOu have to unlink sdlmain from your cflags, i found it easier to edit sdl-config and make two new lines for libs / cflags and remove the SDL_Main bit and replace it with --nomain
Archaemic
Posts: 38
Joined: Sun Mar 18, 2007 7:23 am

Post by Archaemic »

Code: Select all

SDL_FLAGS = $(shell $(PSPBIN)/sdl-config --cflags)
CFLAGS += $(shell echo $(SDL_FLAGS) | sed -re s/-Dmain=\\S+//) #Remove main redefinition
SDL_LIBS = $(shell $(PSPBIN)/sdl-config --libs)
LIBS += $(shell echo $(SDL_LIBS) | sed -e s/-lSDLmain//) #Remove SDLmain from libs
Have that in your makefile instead of

Code: Select all

CFLAGS += $(shell $(PSPBIN)/sdl-config --libs --cflags)
(This won't work if you're not using a Unix-like environment for compilation, e.g. a native Windows toolchain without GnuWin32 installed)

You'll also need your own version of some of the stuff that SDLmain provides, e.g. PSP_MODULE_INFO and setting up the home callback.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Ignore me...
Leo28C
Posts: 19
Joined: Thu Jan 18, 2007 8:20 am

Post by Leo28C »

Wee, thanks! That did the trick. =)
Post Reply