Appology from programmer JeZ+Lee

Appology from programmer JeZ+Lee…

Sorry for spamming the list.

How do I convert a Win32 SDL game to Mac OS X and other platforms ?

JeZ+Lee
SLNTHERO at AOL.com

Hello SlntHero,

Wednesday, August 16, 2006, 11:19:43 PM, you wrote:

Appology from programmer JeZ+Lee…

Sorry for spamming the list.

How do I convert a Win32 SDL game to Mac OS X and other platforms ?

If you are using SDL to handle graphics, sound etc… all you really
have to do is compile it on the platform. You might have to make some
changes to keep GCC (the C++ compiler used on other platforms) happy
but that’s it.

If you’re handling custom data files in any way, you may have to add
byte swapping for big-endian platforms (such as PowerPC based Macs).–
Best regards,
Peter mailto:@Peter_Mulholland

Hello !

How do I convert a Win32 SDL game to Mac OS X and other platforms ?

Do you have these systems yourself ?

CU

Easy way: Get a machine running the intended target system (that is, a
Mac, some Linux box or something else), get development tools for it,
and compile. If you’re not relying on any platform specific APIs, and
your code is endian safe (doesn’t depend on the byte order of
integers and other multi-byte types are stored in memory), it should
pretty much just compile and work. However, even if your code is
correct by design, count on having to make some minor adjustments for
differences between tools, system headers and whatnot.

Hard way: Stick with your preferred development platform (Windows, I
assume), install a cross compiler along with whatever system headers
and stuff you may need, and compile your game using that instead of
your normal compiler. After resolving any build issues (same as
above, basically), you should have an executable that will run on the
intended target platform.

As a real life example, I’m working on a 64 bit AMD Linux system, and
the targets I usually build for and test on are Linux/x86 (32 bit),
Linux/AMD64 (64 bit native), Windows/x86 (32 bit) and Mac OS X/PPC.

I compile for Linux/x86 and Linux/AMD64 using the “normal” native
compiler; just adding an extra option to have the compiler generate
32 bit binaries with 32 bit instructions only.

For Windows, I use a GNU gcc cross compiler.

As Mac OS X uses the same development tools that I use on Linux, I
just do it the easy way: I just build the stuff on the Mac, using my
usual GNU autotools scripts together with the GNU tools that come
with Xcode.

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Thursday 17 August 2006 00:19, SlntHero at aol.com wrote:

Appology from programmer JeZ+Lee…

Sorry for spamming the list.

How do I convert a Win32 SDL game to Mac OS X and other platforms ?

Hello !

If you are using SDL to handle graphics, sound etc… all you really
have to do is compile it on the platform. You might have to make some
changes to keep GCC (the C++ compiler used on other platforms) happy but
that’s it.

If you’re handling custom data files in any way, you may have to add
byte swapping for big-endian platforms (such as PowerPC based Macs).

And you need to keep your filepaths dynamically.
A good way is to have a string that will be initialized at the
programm start, that has these data path.

I use something like this.

CU
-------------- next part --------------
A non-text attachment was scrubbed…
Name: my_file.cpp
Type: text/x-c++src
Size: 455 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060817/34e5e7bf/attachment.cpp
-------------- next part --------------
A non-text attachment was scrubbed…
Name: my_file.h
Type: text/x-chdr
Size: 308 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060817/34e5e7bf/attachment.h