PlatformX86UNIX
by Gary "ChunkyKs" Briggs · in Torque Game Engine · 12/14/2006 (5:34 pm) · 13 replies
Has anyone tried getting platformX86UNIX to build as the Mac OSX platform layer instead of platformMacCarb? I've tried from the command line [not very magical in it's functioning :-/], and by adding them all into XCode in a new target, that doesn't have platformMacCarb, also no such luck...
Gary (-;
Gary (-;
#2
Slap that in your torque examples/ dir, and run it. Needs X11 installed and running, and an intel mac.
Gary (-;
01/04/2007 (3:58 pm)
TorqueX11OSX.dmgSlap that in your torque examples/ dir, and run it. Needs X11 installed and running, and an intel mac.
Gary (-;
#3
01/04/2007 (5:14 pm)
You are a sick, sick man. Thanks very much.
#4
That's the 1.5 demo. You'll need to open it and copy the dir contained to your local drive [torque and it's write permission requirements... *weep*].
Side by side comparison of the 1.5 maccarb demo as supplied [actually, stripped to save bandwidth] with my X11 binary. I haven't put in much effort or thought, so there's a good chance it won't run on anyhting except a core2duo macbook pro, but the difference in performance is startling.
Rob: Glad you found it of interest :-)
Gary (-;
01/04/2007 (5:25 pm)
chunky.megastep.org/TGE1.5Demo.dmgThat's the 1.5 demo. You'll need to open it and copy the dir contained to your local drive [torque and it's write permission requirements... *weep*].
Side by side comparison of the 1.5 maccarb demo as supplied [actually, stripped to save bandwidth] with my X11 binary. I haven't put in much effort or thought, so there's a good chance it won't run on anyhting except a core2duo macbook pro, but the difference in performance is startling.
Rob: Glad you found it of interest :-)
Gary (-;
#5
01/05/2007 (3:32 pm)
The first link (app by itself) doesn't run for me (MacBook Pro Core2 Duo, X11 running) but I'll give the full download a try later. You got me hooked. Now I'm really curious as to WHY there's a stunning performance difference.
#6
Gary (-;
01/05/2007 (3:48 pm)
The performance difference was [I think] because platformX86UNIX is enabling assembly stuffs, wheras maccarb wasn't.Gary (-;
#7
That said, this is awesome. I'd give it a try if I had the time. It's definitely interesting to learn about the performance differences.
01/05/2007 (6:59 pm)
Rob is right; you are a disturbed individual.That said, this is awesome. I'd give it a try if I had the time. It's definitely interesting to learn about the performance differences.
#8
Dude... I'm using a mac. Of course I'm disturbed.
Gary (-;
01/05/2007 (7:12 pm)
Quote: you are a disturbed individual
Dude... I'm using a mac. Of course I'm disturbed.
Gary (-;
#9
Configure SDL with
Also, this should be your library search path:
/Users/chunky/sdl/lib/ /usr/X11R6/lib $(inherited)
And this should be your User Header Search Path:
../engine ../lib ../lib/lpng ../lib/ljpeg ../lib/lungif ../lib/openal/macosx/eax /Users/chunky/sdl/include/ /usr/X11R6/include/ /usr/X11R6/include/freetype2/
and this trainwreck is my Other Linker Flags:
-lX11 -lXext -lXft -lGLU -lz -lode -lSDLmain /Users/chunky/sdl/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,IOKit -Wl,-framework,Cocoa -Wl,-framework,QuickTime -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit
So I *hope* that TorqueX11OSX.dmg should now work on any system, since it has SDL statically linked... could anyone verify this?
Gary (-;
PS You can also use it as TGB1.1.3 if you want to be obtuse about it :-)
01/11/2007 (7:02 pm)
Turns out you don't need fink, after all. Also, to get SDL to link statically, I had to change thus:Configure SDL with
./configure \ --prefix=/Users/chunky/sdl \ --disable-audio \ --enable-joystick \ --with-x \ --x-include=/usr/X11R6/include \ --x-libraries=/usr/X11R6/lib \ --enable-video-x11 \ --enable-video-opengl \ --enable-video-x11-dpms=no \ --enable-video-x11-xrandr=no \ --enable-video-x11-xme=no \ --enable-video-x11-vm=no \ --enable-x11-shared=no
Also, this should be your library search path:
/Users/chunky/sdl/lib/ /usr/X11R6/lib $(inherited)
And this should be your User Header Search Path:
../engine ../lib ../lib/lpng ../lib/ljpeg ../lib/lungif ../lib/openal/macosx/eax /Users/chunky/sdl/include/ /usr/X11R6/include/ /usr/X11R6/include/freetype2/
and this trainwreck is my Other Linker Flags:
-lX11 -lXext -lXft -lGLU -lz -lode -lSDLmain /Users/chunky/sdl/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,IOKit -Wl,-framework,Cocoa -Wl,-framework,QuickTime -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit
So I *hope* that TorqueX11OSX.dmg should now work on any system, since it has SDL statically linked... could anyone verify this?
Gary (-;
PS You can also use it as TGB1.1.3 if you want to be obtuse about it :-)
#10
If you're meaning on any stock system (with no X11R6 tweaking) then we're missing libX11.6.dylib.
Link (dyld) error:
Library not loaded: /usr/X11R6/lib/libX11.6.dylib
I'm running Mac OS X 10.4.8 on a MacBook Pro.
01/12/2007 (8:45 pm)
Hi Gary,If you're meaning on any stock system (with no X11R6 tweaking) then we're missing libX11.6.dylib.
Link (dyld) error:
Library not loaded: /usr/X11R6/lib/libX11.6.dylib
I'm running Mac OS X 10.4.8 on a MacBook Pro.
#11
Gary (-;
01/13/2007 (11:46 am)
Uh... hm. If you still have your XCode installer on hand, could you try re-running it and making sure that the X11 dev packages are enabled? I think that if you install X11 after XCode, this could happen?Gary (-;
#12
I re-downloaded and installed XCode Tools, double-checked that X11 SDK was checked but still get the same thing in the Torque X11 OSX.crash.log:
Command: Torque X11 OSX
Path: /Developer/Torque Game Engine 1.5 SDK/Torque SDK/example/Torque X11 OSX.app/Contents/MacOS/Torque X11 OSX
Parent: WindowServer [59]
Version:
01/13/2007 (3:01 pm)
Hi Gary,I re-downloaded and installed XCode Tools, double-checked that X11 SDK was checked but still get the same thing in the Torque X11 OSX.crash.log:
Command: Torque X11 OSX
Path: /Developer/Torque Game Engine 1.5 SDK/Torque SDK/example/Torque X11 OSX.app/Contents/MacOS/Torque X11 OSX
Parent: WindowServer [59]
Version:
#13
Command: Torque X11 OSX
Path: /Developer/Torque Game Engine 1.5 SDK/Torque SDK/example/Torque X11 OSX.app/Contents/MacOS/Torque X11 OSX
Parent: WindowServer [59]
Version: GarageGames.com, Inc. All rights reserved. (1.5.0)
PID: 733
Thread: Unknown
Link (dyld) error:
Library not loaded: /usr/X11R6/lib/libX11.6.dylib
Referenced from: /Developer/Torque Game Engine 1.5 SDK/Torque SDK/example/Torque X11 OSX.app/Contents/MacOS/Torque X11 OSX
Reason: image not found
01/13/2007 (3:03 pm)
Hmm, didn't seem to like the copyright symbol so it truncated the log.Command: Torque X11 OSX
Path: /Developer/Torque Game Engine 1.5 SDK/Torque SDK/example/Torque X11 OSX.app/Contents/MacOS/Torque X11 OSX
Parent: WindowServer [59]
Version: GarageGames.com, Inc. All rights reserved. (1.5.0)
PID: 733
Thread: Unknown
Link (dyld) error:
Library not loaded: /usr/X11R6/lib/libX11.6.dylib
Referenced from: /Developer/Torque Game Engine 1.5 SDK/Torque SDK/example/Torque X11 OSX.app/Contents/MacOS/Torque X11 OSX
Reason: image not found
Torque Owner Gary "ChunkyKs" Briggs
Clicky for more a bigger picture with more detail:
Let's see. This is heavily an exercise for the reader, but [I'm using XCode]:
1) Create a new target by copying one of your current targets
2) Remove all of platformMacCarb stuff from the build, add in all of X86UNIX, except for CPUInfo, Strings, Net, Audio/OpenAL, dedicatedStub, Memory, Redbook.
3) GameInterface::main needs to be renamed through the entire project, thanks to an SDL sniglet. I used GameInterface::mainGI. It makes appearances in these files:
4) I configured SDL thus:
5) You'll need a fair amount of packages out of fink. freetype immediately springs to mind, there are probably others.
6) Set some environment variables so SDL will use X11, by editing your current executable [DISPLAY=:0, SDL_VIDEODRIVER=x11]
7) You need these fixes [you don't think those fixes just appeared out of the ether, do you? :-D]
8) x86UNIXGL.cc needs its SDL_GL_LoadLibrary call changed to SDL_GL_LoadLibrary(NULL) so it'll magically read in the right library.
You'll definitely need to add a bunch of compiler and linker flags. I have these prefixed on my include path:
And these prefixed on my library path:
as well as these additional custom link flags:
I'm sure I left stuff out. Among other things, SDL is compiled into its own prefix, you'll need to pick a different one unless your username is chunky.
Gary (-;
EDIT: Markup Sniglets