SDL on the Mac

I took a look at the .9.9 code, and saw that it was pretty much GWorld
only support after I sent you the email. Putting DSp support in
wouldn’t be hard, nor would sound.

Hey, I just updated the CVS source code to work with the Apple MPW
development tools. You’ll need to grab the latest CVS snapshot to
compile SDL, since some code had changed since the last time I worked
on the Mac side of things.

Currently, the library fails in SDL_SYS_SetVideoMode(), because the
NewGWorld() call is failing.

I’m running MacOS 8.6.

If you have any ideas why NewGWorld() is failing, please let me know. :slight_smile:
I can send you an MPW Makefile to compile SDL, if you want.

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Currently, the library fails in SDL_SYS_SetVideoMode(), because the
NewGWorld() call is failing.

I found the problem. MPW doesn’t create a SIZE resource by default.
I’ll add one to the SDL.r file.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Sam Lantinga wrote:

If you have any ideas why NewGWorld() is failing, please let me know. :slight_smile:
I can send you an MPW Makefile to compile SDL, if you want.

I have been trying to get SDL to compile with MPW for a while. :slight_smile: The
Mac is a little different than the GNU tools I usually use. May I have a
copy of the Makefile to build SDL with MPW? I would really appreciate
it.

Thanks in Advance,
Max Watson

Sam Lantinga wrote:

If you have any ideas why NewGWorld() is failing, please let me know. :slight_smile:
I can send you an MPW Makefile to compile SDL, if you want.

I have been trying to get SDL to compile with MPW for a while. :slight_smile: The
Mac is a little different than the GNU tools I usually use. May I have a
copy of the Makefile to build SDL with MPW? I would really appreciate
it.

Sure. I just fixed a bunch of things in the SDL code to allow it to
compile in the MPW environment, so be sure to grab the latest CVS
snapshot of SDL. Also, I’ve only tested it with the latest MPW GM
release from Apple’s FTP site.

When you build the sample programs, you need to link with the SDL.o
stub library, use Rez to include the src/stub/macos/SDL.r resources
in your program, and copy the “SDL” shared library to the directory
that your program is running in.

Remember, this is alpha quality! :slight_smile:
The only thing that works is graphics on 16 and 32 bit displays on PPC.

Eventually an archive of sample build files for MacOS will be included
with SDL. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec
-------------- next part --------------

Makefile for Apple MPW build environment (currently PPC only)

MAKEFILE = Makefile
?MondoBuild? = #{MAKEFILE} # Make blank to avoid rebuilds when makefile is modified
SDL_INC = ?
-i “:include:” ?
-i “:src:” ?
-i “:src:macos:” ?
-i ":src:macos:toolbox:"
STUB_INC = ?
-i :include: ?
-i :src:stub: ?
-I :src:stub:macos
Sym?PPC =
ObjDir?PPC = :obj:

SDL_CFLAGS = {SDL_INC} {Sym?PPC} -w 35 -d _BUILDING_SDL
STUB_CFLAGS = {STUB_INC}

SDLOBJS = ?
"{ObjDir?PPC}SDL.c.x" ?
"{ObjDir?PPC}SDL_active.c.x" ?
"{ObjDir?PPC}SDL_audio.c.x" ?
"{ObjDir?PPC}SDL_audiocvt.c.x" ?
"{ObjDir?PPC}SDL_audiomem.c.x" ?
"{ObjDir?PPC}SDL_blit.c.x" ?
"{ObjDir?PPC}SDL_blit_0.c.x" ?
"{ObjDir?PPC}SDL_blit_1.c.x" ?
"{ObjDir?PPC}SDL_blit_A.c.x" ?
"{ObjDir?PPC}SDL_blit_AK.c.x" ?
"{ObjDir?PPC}SDL_blit_K.c.x" ?
"{ObjDir?PPC}SDL_blit_N.c.x" ?
"{ObjDir?PPC}SDL_bmp.c.x" ?
"{ObjDir?PPC}SDL_cdrom.c.x" ?
"{ObjDir?PPC}SDL_cursor.c.x" ?
"{ObjDir?PPC}SDL_endian.c.x" ?
"{ObjDir?PPC}SDL_error.c.x" ?
"{ObjDir?PPC}SDL_events.c.x" ?
"{ObjDir?PPC}SDL_fatal.c.x" ?
"{ObjDir?PPC}SDL_keyboard.c.x" ?
"{ObjDir?PPC}SDL_mixer.c.x" ?
"{ObjDir?PPC}SDL_mouse.c.x" ?
"{ObjDir?PPC}SDL_pixels.c.x" ?
"{ObjDir?PPC}SDL_quit.c.x" ?
"{ObjDir?PPC}SDL_RLEaccel.c.x" ?
"{ObjDir?PPC}SDL_rwops.c.x" ?
"{ObjDir?PPC}SDL_surface.c.x" ?
"{ObjDir?PPC}SDL_video.c.x" ?
"{ObjDir?PPC}SDL_wave.c.x" ?
"{ObjDir?PPC}SDL_mutex.c.x" ?
"{ObjDir?PPC}SDL_syscdrom.c.x" ?
"{ObjDir?PPC}SDL_thread.c.x" ?
"{ObjDir?PPC}SDL_timer.c.x" ?
"{ObjDir?PPC}SDL_sysaudio.c.x" ?
"{ObjDir?PPC}SDL_sysevents.c.x" ?
"{ObjDir?PPC}SDL_sysmouse.c.x" ?
"{ObjDir?PPC}SDL_sysvideo.c.x" ?
"{ObjDir?PPC}SDL_syswm.c.x"

STUBOBJS = ?
"{ObjDir?PPC}load.c.x" ?
"{ObjDir?PPC}macmain.c.x"

This is used to build a static library of SDL

You also need to add “-d _SDL_STATIC_LIB” to the compiler options

#SDL ?? directories {?MondoBuild?} {SDLOBJS} “{ObjDir?PPC}macmain.c.x”

PPCLink ?

-o “:lib:{Targ}”.o {Sym?PPC} ?

{SDLOBJS} “{ObjDir?PPC}macmain.c.x” ?

-c ‘???’ ?

-xm l

This is used to build a dynamic library of SDL

SDL ?? {?MondoBuild?} directories SDL.o {SDLOBJS}
PPCLink ?
-o “:lib:{Targ}” {Sym?PPC} ?
{SDLOBJS} ?
- at export “:src:macos:exports:SDL.x” ?
-t ‘shlb’ ?
-c ‘???’ ?
-xm s ?
"{SharedLibraries}InterfaceLib" ?
"{SharedLibraries}StdCLib" ?
"{SharedLibraries}MathLib" ?
"{PPCLibraries}StdCRuntime.o" ?
"{PPCLibraries}PPCCRuntime.o" ?
"{PPCLibraries}PPCToolLibs.o"

This is used to build the static stub library of SDL

SDL.o ?? {?MondoBuild?} {STUBOBJS}
PPCLink ?
-o :lib:{Targ} {Sym?PPC} ?
{STUBOBJS} ?
-c ‘???’ ?
-xm l

This is used to create the directories needed for build

directories ?
if !Exists obj ; NewFolder obj ; end
if !Exists lib ; NewFolder lib ; end

The SDL library objects

“{ObjDir?PPC}SDL.c.x” ? {?MondoBuild?} “:src:SDL.c”
{PPCC} “:src:SDL.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_active.c.x” ? {?MondoBuild?} “:src:SDL_active.c”
{PPCC} “:src:SDL_active.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_audio.c.x” ? {?MondoBuild?} “:src:SDL_audio.c”
{PPCC} “:src:SDL_audio.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_audiocvt.c.x” ? {?MondoBuild?} “:src:SDL_audiocvt.c”
{PPCC} “:src:SDL_audiocvt.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_audiomem.c.x” ? {?MondoBuild?} “:src:SDL_audiomem.c”
{PPCC} “:src:SDL_audiomem.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_blit.c.x” ? {?MondoBuild?} “:src:SDL_blit.c”
{PPCC} “:src:SDL_blit.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_blit_0.c.x” ? {?MondoBuild?} “:src:SDL_blit_0.c”
{PPCC} “:src:SDL_blit_0.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_blit_1.c.x” ? {?MondoBuild?} “:src:SDL_blit_1.c”
{PPCC} “:src:SDL_blit_1.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_blit_A.c.x” ? {?MondoBuild?} “:src:SDL_blit_A.c”
{PPCC} “:src:SDL_blit_A.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_blit_AK.c.x” ? {?MondoBuild?} “:src:SDL_blit_AK.c”
{PPCC} “:src:SDL_blit_AK.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_blit_K.c.x” ? {?MondoBuild?} “:src:SDL_blit_K.c”
{PPCC} “:src:SDL_blit_K.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_blit_N.c.x” ? {?MondoBuild?} “:src:SDL_blit_N.c”
{PPCC} “:src:SDL_blit_N.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_bmp.c.x” ? {?MondoBuild?} “:src:SDL_bmp.c”
{PPCC} “:src:SDL_bmp.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_cdrom.c.x” ? {?MondoBuild?} “:src:SDL_cdrom.c”
{PPCC} “:src:SDL_cdrom.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_cursor.c.x” ? {?MondoBuild?} “:src:SDL_cursor.c”
{PPCC} “:src:SDL_cursor.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_endian.c.x” ? {?MondoBuild?} “:src:SDL_endian.c”
{PPCC} “:src:SDL_endian.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_error.c.x” ? {?MondoBuild?} “:src:SDL_error.c”
{PPCC} “:src:SDL_error.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_events.c.x” ? {?MondoBuild?} “:src:SDL_events.c”
{PPCC} “:src:SDL_events.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_fatal.c.x” ? {?MondoBuild?} “:src:SDL_fatal.c”
{PPCC} “:src:SDL_fatal.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_keyboard.c.x” ? {?MondoBuild?} “:src:SDL_keyboard.c”
{PPCC} “:src:SDL_keyboard.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_mixer.c.x” ? {?MondoBuild?} “:src:SDL_mixer.c”
{PPCC} “:src:SDL_mixer.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_mouse.c.x” ? {?MondoBuild?} “:src:SDL_mouse.c”
{PPCC} “:src:SDL_mouse.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_pixels.c.x” ? {?MondoBuild?} “:src:SDL_pixels.c”
{PPCC} “:src:SDL_pixels.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_quit.c.x” ? {?MondoBuild?} “:src:SDL_quit.c”
{PPCC} “:src:SDL_quit.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_RLEaccel.c.x” ? {?MondoBuild?} “:src:SDL_RLEaccel.c”
{PPCC} “:src:SDL_RLEaccel.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_rwops.c.x” ? {?MondoBuild?} “:src:SDL_rwops.c”
{PPCC} “:src:SDL_rwops.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_surface.c.x” ? {?MondoBuild?} “:src:SDL_surface.c”
{PPCC} “:src:SDL_surface.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_video.c.x” ? {?MondoBuild?} “:src:SDL_video.c”
{PPCC} “:src:SDL_video.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_wave.c.x” ? {?MondoBuild?} “:src:SDL_wave.c”
{PPCC} “:src:SDL_wave.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_mutex.c.x” ? {?MondoBuild?} “:src:macos:SDL_mutex.c”
{PPCC} “:src:macos:SDL_mutex.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_syscdrom.c.x” ? {?MondoBuild?} “:src:macos:SDL_syscdrom.c”
{PPCC} “:src:macos:SDL_syscdrom.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_thread.c.x” ? {?MondoBuild?} “:src:macos:SDL_thread.c”
{PPCC} “:src:macos:SDL_thread.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_timer.c.x” ? {?MondoBuild?} “:src:macos:SDL_timer.c”
{PPCC} “:src:macos:SDL_timer.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_sysaudio.c.x” ? {?MondoBuild?} “:src:macos:toolbox:SDL_sysaudio.c”
{PPCC} “:src:macos:toolbox:SDL_sysaudio.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_sysevents.c.x” ? {?MondoBuild?} “:src:macos:toolbox:SDL_sysevents.c”
{PPCC} “:src:macos:toolbox:SDL_sysevents.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_sysmouse.c.x” ? {?MondoBuild?} “:src:macos:toolbox:SDL_sysmouse.c”
{PPCC} “:src:macos:toolbox:SDL_sysmouse.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_sysvideo.c.x” ? {?MondoBuild?} “:src:macos:toolbox:SDL_sysvideo.c”
{PPCC} “:src:macos:toolbox:SDL_sysvideo.c” -o {Targ} {SDL_CFLAGS}

“{ObjDir?PPC}SDL_syswm.c.x” ? {?MondoBuild?} “:src:macos:toolbox:SDL_syswm.c”
{PPCC} “:src:macos:toolbox:SDL_syswm.c” -o {Targ} {SDL_CFLAGS}

Objects for the stub library

“{ObjDir?PPC}load.c.x” ? {?MondoBuild?} :src:stub:load.c
{PPCC} :src:stub:load.c -o {Targ} {STUB_CFLAGS}

“{ObjDir?PPC}macmain.c.x” ? {?MondoBuild?} :src:stub:macos:macmain.c
{PPCC} :src:stub:macos:macmain.c -o {Targ} {STUB_CFLAGS}

Anyone know how I un-subscribe from this group? I would love to stick
around, but the only email I get lately is from SDL…and its a bit out of
my area right now.

Thanks.

Kevin Duffey
@Kevin_Duffey

“You wont get muscles watching me lift weights”

Anyone know how I un-subscribe from this group? I would love to stick
around, but the only email I get lately is from SDL…and its a bit out of
my area right now.

Send e-mail to sdl-unsubscribe at surfnetcity.com.au

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec