MacOsX Version issues
Moderator: Committer
Re: MacOsX Version issues
Thanks for doing this! Ok, here's my take on your GG patch. I changed some formatting-type stuff, and s/NULL/0. Do these changes work for you? If so, I'll be committing these files as they are here, including your copyright. If you approve, I'll take this as written consent to release this code under LGPL.
Now, I have a couple of questions:
Why do you start so many of your string literals with '\p' (e.g. "\pOpenGL.framework")?
Did you build GG with its SCons build system? It appears you did not, since I found "#ifdef FREEORION_MACOSX" in your changes to GG/Ogre/OgreGUI.h. Before I can accept this patch for GG's trunk, I'll need your assurance that the SCons build works. Otherwise, I'll stick this changeset in a patches directory in the GG repository.
Now, I have a couple of questions:
Why do you start so many of your string literals with '\p' (e.g. "\pOpenGL.framework")?
Did you build GG with its SCons build system? It appears you did not, since I found "#ifdef FREEORION_MACOSX" in your changes to GG/Ogre/OgreGUI.h. Before I can accept this patch for GG's trunk, I'll need your assurance that the SCons build works. Otherwise, I'll stick this changeset in a patches directory in the GG repository.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: MacOsX Version issues
Someone posted a crash bug about the Mac OSX version on sourceforge:
https://sourceforge.net/tracker/index.p ... tid=544942
https://sourceforge.net/tracker/index.p ... tid=544942
Re: MacOsX Version issues
yes, I can arrange thatGeoff the Medio wrote:Your patch for freeorion doesn't appear to contain the XCode project files. Can those be bundled up in a ready-to-use way and put in SVN as well?
should I just include the XCode project or all the dependencies?
the whole mac SDK may be >50MBs.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: MacOsX Version issues
If there are a bunch of dependencies you need to build separately, then you should probably make an SDK like the Windows SDK that's already on SF as a separate download. The SDK will contain all the dependencies pre-built and a snapshot of the code and data off SVN, with subversion directories so that after downloading the SDK, the user can update from SVN to get any recent changes to the code or project files. Only the project files will go in SVN, so that they can be updated whenever files are added or removed from the build..Id wrote:yes, I can arrange thatGeoff the Medio wrote:Your patch for freeorion doesn't appear to contain the XCode project files. Can those be bundled up in a ready-to-use way and put in SVN as well?
should I just include the XCode project or all the dependencies?
the whole mac SDK may be >50MBs.
Re: MacOsX Version issues
Anything that's copyright from me, I didn't intend to have there.tzlaine wrote:Thanks for doing this! Ok, here's my take on your GG patch. I changed some formatting-type stuff, and s/NULL/0. Do these changes work for you? If so, I'll be committing these files as they are here, including your copyright. If you approve, I'll take this as written consent to release this code under LGPL.
But the aglGetProcAddress files are actually apple's work:
http://developer.apple.com/qa/qa2001/qa1188.html which I should have made clear, sorry.
That was curious to me, too and I forgot to look into it.Now, I have a couple of questions:
Why do you start so many of your string literals with '\p' (e.g. "\pOpenGL.framework")?
I didn't use SCons. Considering a SCons build wasn't previously supported on a mac platform, I'll take you mean the changes don't break win32 or posix. And I'm fairly certain they don't, since everything would be preprocessed out and the aglGetProcAddress files do not even need to be looked at for those platforms. Would confirming a GG SCons build with this patch on linux suffice?Did you build GG with its SCons build system? It appears you did not, since I found "#ifdef FREEORION_MACOSX" in your changes to GG/Ogre/OgreGUI.h. Before I can accept this patch for GG's trunk, I'll need your assurance that the SCons build works. Otherwise, I'll stick this changeset in a patches directory in the GG repository.
Re: MacOsX Version issues
I think the XCode project should be in the repo, but not the SDK. The SDK is bound to not change often anyway, right?
Re: MacOsX Version issues
Glad, I checked this. There was a bug where I #ifdef instead of #if, use this patch for OgreGUI.cpp instead of what was in previous files:tzlaine wrote: Did you build GG with its SCons build system? It appears you did not, since I found "#ifdef FREEORION_MACOSX" in your changes to GG/Ogre/OgreGUI.h. Before I can accept this patch for GG's trunk, I'll need your assurance that the SCons build works. Otherwise, I'll stick this changeset in a patches directory in the GG repository.
Code: Select all
Index: src/Ogre/OgreGUI.cpp
===================================================================
--- src/Ogre/OgreGUI.cpp (revision 711)
+++ src/Ogre/OgreGUI.cpp (working copy)
@@ -33,6 +33,10 @@
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#include <GL/gl.h>
#include <GG/glext.h>
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include "aglGetProcAddress.h"
#else
#include <GL/glx.h>
#endif
@@ -191,6 +195,10 @@
typedef void (*BindBufferARBFn)(GLenum, GLuint);
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
BindBufferARBFn glBindBufferARB = (BindBufferARBFn)wglGetProcAddress("glBindBufferARB");
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+ OSStatus err = aglInitEntryPoints (); //init bundle
+ if (err != noErr) Exit(err);
+ BindBufferARBFn glBindBufferARB = (BindBufferARBFn)aglGetProcAddress("glBindBufferARB");
#else
BindBufferARBFn glBindBufferARB = (BindBufferARBFn)glXGetProcAddress((const GLubyte* )"glBindBufferARB");
#endif
@@ -204,6 +212,8 @@
typedef void (*UseProgramARBFn)(GLuint);
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
UseProgramARBFn glUseProgramARB = (UseProgramARBFn)wglGetProcAddress("glUseProgramARB");
+#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+ UseProgramARBFn glUseProgramARB = (UseProgramARBFn)aglGetProcAddress("glUseProgramARB");
#else
UseProgramARBFn glUseProgramARB = (UseProgramARBFn)glXGetProcAddress((const GLubyte* )"glUseProgramARB");
#endif
@@ -222,6 +232,9 @@
void OgreGUI::Exit2DMode()
{
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+ aglDellocEntryPoints();
+#endif
glPopClientAttrib();
glPopAttrib();
}
Code: Select all
Index: GG/Ogre/OgreGUI.h
===================================================================
--- GG/Ogre/OgreGUI.h (revision 711)
+++ GG/Ogre/OgreGUI.h (working copy)
@@ -29,6 +29,21 @@
#ifndef _GG_OgreGUI_h_
#define _GG_OgreGUI_h_
+#ifdef __APPLE__
+/* prevents OpenTransportProviders.h (a system header in Mac SDKs)
+ from trying to enum what's already defined by includeing it elsewhere */
+#undef TCP_NODELAY
+#undef TCP_MAXSEG
+#undef TCP_NOTIFY_THRESHOLD
+#undef TCP_ABORT_THRESHOLD
+#undef TCP_CONN_NOTIFY_THRESHOLD
+#undef TCP_CONN_ABORT_THRESHOLD
+#undef TCP_OOBINLINE
+#undef TCP_URGENT_PTR_TYPE
+#undef TCP_KEEPALIVE
+#include <Carbon/Carbon.h>
+#endif
+
#include <OgreDataStream.h>
#include <OgreRenderTargetListener.h>
#include <OgreSharedPtr.h>
I can rewrite that code to get OpenGL entry points if you'd like.
Re: MacOsX Version issues
Right. Not as frequent as the Xcode project.Naesbye wrote:I think the XCode project should be in the repo, but not the SDK. The SDK is bound to not change often anyway, right?
Re: MacOsX Version issues
Patch to add the Xcode project is attached.
Universal Binary: FreeOrion 0.3.12 rev 2913
I redid some things with boost dependency; maybe it will play nice with PPC. There's one obvious bug that I haven't fixed, just worked around so far. See the bug.zip attachment for details. I'd really appreciate any suggestions or help in fixing it.
Run the "unpack-FO" shell script after downloading everything.
Mac SDK: rev 2913 included
An SDK for Mac that includes all dependencies and svn revision 2913 of the code.
Run the "unpack-sdk" shell script after downloading everything.
Universal Binary: FreeOrion 0.3.12 rev 2913
I redid some things with boost dependency; maybe it will play nice with PPC. There's one obvious bug that I haven't fixed, just worked around so far. See the bug.zip attachment for details. I'd really appreciate any suggestions or help in fixing it.
Run the "unpack-FO" shell script after downloading everything.
Mac SDK: rev 2913 included
An SDK for Mac that includes all dependencies and svn revision 2913 of the code.
Run the "unpack-sdk" shell script after downloading everything.
- Attachments
-
- bug.zip
- Crash on clicking "Exit" seems isolated to the Mac build.
- (2.52 KiB) Downloaded 95 times
-
- FO-Xcode-patch.zip
- Patch to add Xcode project to svn.
- (25.51 KiB) Downloaded 93 times
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: MacOsX Version issues
err, how do you do that?.Id wrote: Run the "unpack-FO" shell script after downloading everything.
"run" doesn't seem to be the necessary command.
Re: MacOsX Version issues
'\p' is a relic from the days of old, when the Mac Toolbox was in ROM and Pascal-based
It denotes that the string is a Pascal string, and gets substituted with a length count (to indicate the length of the string), as opposed to a C string which ends when a 0x00 (zero) is encountered.
If I remember correctly. But those Pascal strings should die a horrible death, if possible.
It denotes that the string is a Pascal string, and gets substituted with a length count (to indicate the length of the string), as opposed to a C string which ends when a 0x00 (zero) is encountered.
If I remember correctly. But those Pascal strings should die a horrible death, if possible.
Re: MacOsX Version issues
Double clicking from the Finder should (hopefully) work.eleazar wrote:err, how do you do that?.Id wrote: Run the "unpack-FO" shell script after downloading everything.
"run" doesn't seem to be the necessary command.
Inside a terminal, just typing the full path of the script would work, or change directory to it and do `./unpack-FO`
This is all provided that the execute permission is set on that script: `chmod u+x unpack-FO`
Re: MacOsX Version issues
Thanks for the hint about Pascal strings.
I doubt they're necessary for the purposes of that particular code. It was mostly appearing in error/debug strings except 1 place.
So I'll review it and probably rewrite it sometime for practice/fun, but feel free to beat me to it and we can compare notes.
I doubt they're necessary for the purposes of that particular code. It was mostly appearing in error/debug strings except 1 place.
So I'll review it and probably rewrite it sometime for practice/fun, but feel free to beat me to it and we can compare notes.
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: MacOsX Version issues
thanks that worked
Re: MacOsX Version issues
Have any of you guys bumped into this lib error yet?
dyld: Library not loaded: /usr/lib/libexpat.1.dylib
Referenced from: /Users/.../Desktop/FreeOrion.app/Contents/MacOs/../SharedSupport/libgvc_builtins.dylib
Reason: image not found
Trace/BPT trap
I downloaded the FreeOrion 0.3.11 UB from sourceforge, and I started to get library errors. So I installed X11, and now i'm getting this expat.1.dylib error. I found a libexpat.1.0.dylib on my computer, but i couldn't find 1.0. Anybody mind pointing me to it, or perhaps giving me a hint?
Oh, btw, I'm running an old MBP, first hardware iteration with 10.4.
Update: Just downloaded the last version of the SDK you posted. Couldn't find any libexpat in it. Am I looking in the wrong place, or is this just a lib i should already have had?
dyld: Library not loaded: /usr/lib/libexpat.1.dylib
Referenced from: /Users/.../Desktop/FreeOrion.app/Contents/MacOs/../SharedSupport/libgvc_builtins.dylib
Reason: image not found
Trace/BPT trap
I downloaded the FreeOrion 0.3.11 UB from sourceforge, and I started to get library errors. So I installed X11, and now i'm getting this expat.1.dylib error. I found a libexpat.1.0.dylib on my computer, but i couldn't find 1.0. Anybody mind pointing me to it, or perhaps giving me a hint?
Oh, btw, I'm running an old MBP, first hardware iteration with 10.4.
Update: Just downloaded the last version of the SDK you posted. Couldn't find any libexpat in it. Am I looking in the wrong place, or is this just a lib i should already have had?