Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Cross-Platform Development => Topic started by: rsaxvc on August 08, 2009, 12:20:38 am

Title: OSX: Snow Leopard(10.6) issues
Post by: rsaxvc on August 08, 2009, 12:20:38 am
So, GLInt on 10.6 is an actual int now, instead of a long(which it was in <10.4?)

So the line in gropengl.cpp
 CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, (long*)&status);
should become
 CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, (int*)&status);

For 10.6, and maybe 10.5?
Title: Re: OSX: Snow Leopard(10.6) issue
Post by: blowfish on August 08, 2009, 12:30:46 am
You've got one of the Developer builds, I take it?  This could probably be accomplished with some #IFDEF macros...
Title: Re: OSX: Snow Leopard(10.6) issue
Post by: rsaxvc on August 08, 2009, 12:33:49 am
Easily, just add another case to the existing structure. And by easily, I mean easy for someone more familiar with OSx type stuff. Specifically, the macros check for windows versus Apple, we'd need some way to  differentiate betwixt versions.
Title: Re: OSX: Snow Leopard(10.6) issue
Post by: portej05 on August 08, 2009, 12:36:49 am
Easily, just add another case to the existing structure. And by easily, I mean easy for someone more familiar with OSx type stuff. Specifically, the macros check for windows versus Apple, we'd need some way to  differentiate betwixt versions.


Why not just use GLInt?
Title: Re: OSX: Snow Leopard(10.6) issue
Post by: rsaxvc on August 08, 2009, 12:56:40 am
@portej Really good point.

I'm not certain why we're casting it at all. Status is a GLInt, and CGLSetParameter needs a GLInt*... Yep, works fine without casting the pointer at all.



http://developer.apple.com/documentation/graphicsimaging/reference/CGL_OpenGL/Reference/reference.html#//apple_ref/c/func/CGLSetParameter
Title: Re: OSX: Snow Leopard(10.6) issue
Post by: Echelon9 on August 08, 2009, 01:03:57 am
I've made a preliminary change to gropengl.cpp in r5510.
Title: Re: OSX: Snow Leopard(10.6) issues
Post by: rsaxvc on August 09, 2009, 10:11:40 am
WARNING: "Cannot chdir to ./fs2_open_d: Not a directory" at /Users/richardallen/code/fs2_open-wanderer/projects/Xcode/../../code/windows_stub/stubs.cpp:402

It seems to try and chdir to whatever the launch path is. (argv[0]). This only happens in DEBUG. Is this something to worry about?
Title: Re: OSX: Snow Leopard(10.6) issues
Post by: portej05 on August 09, 2009, 10:28:18 am
yeah, it won't like being run from the build directory.
You need to copy the build to the game directory.
Title: Re: OSX: Snow Leopard(10.6) issues
Post by: rsaxvc on August 09, 2009, 12:09:06 pm
it was in the game directory. Also, I've named the executable fs2_open_d.
Title: Re: OSX: Snow Leopard(10.6) issues
Post by: blowfish on August 09, 2009, 01:29:22 pm
Did you rename the app or the actual executable?
Title: Re: OSX: Snow Leopard(10.6) issues
Post by: rsaxvc on August 09, 2009, 02:07:16 pm
executable. Although running the app gives the same error, but with the executables original name.
Title: Re: OSX: Snow Leopard(10.6) issues
Post by: blowfish on August 09, 2009, 02:28:35 pm
Unless you really know what you're doing, changing the name of the executable isn't generally considered a good idea.  You should be able to change the name of the app just fine though ... I do it all the time.
Title: Re: OSX: Snow Leopard(10.6) issues
Post by: chief1983 on August 10, 2009, 10:14:10 am
Yup rsa, you don't want to rename stuff inside of the Universal Binary.  Just rename the .app itself.
Title: Re: OSX: Snow Leopard(10.6) issues
Post by: rsaxvc on August 10, 2009, 10:09:01 pm
But... it happens when launching the app too.

WARNING: "Cannot chdir to ./FS2_Open (debug): Not a directory" at /Users/richardallen/code/fs2_open-wanderer/projects/Xcode/../../code/windows_stub/stubs.cpp:402