Convert Windows application to Mac application

Discussion in 'Mac Programming' started by Stéphane-M, Jan 11, 2011.

  1. Stéphane-M macrumors newbie

    Joined:
    Jan 11, 2011
    #1
    My flight simulation club is working on the development on an opensource flight simulator (Fly! Legacy) under GPL license.
    http://sourceforge.net/projects/flylegacy/

    Currently, only a Windows version of this software is available and so, one or several people would be necessary to help us to convert this Windows application to a Mac application.
    The application was developed in C++ and was compiled with Visual Studio 2008.
    About the librairies included in the project, I don't know all because I'm not developer of the project but I can tell you that uses:
    _ OpenGL
    _ OpenAL
    _ FreeImage
    _ OPAL-ODE
    _ Glew
    _ PThread
    _ STLport (not sure)
    Could you help us ?
    Thank you for your cooperation.
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Help you how? What kind of help are you looking for?
     
  3. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #3
    It depends on how the application was designed. It could be a bit of work, or it could be lots of work. Mac supports C++ and OpenGL. So that's covered. But any part of the code that deals with the non-OpenGL user interface and/or integrates with Windows will probably have to be re-written. Probably in Objective-C because that's the language used by all of the Mac libraries.

    This might be an opportunity to redesign the application to abstract out the game logic from the presentation logic. In other words, move toward an MVC design which is recommend in all of the Apple docs. :)
     
  4. Stéphane-M, Jan 12, 2011
    Last edited: Jan 12, 2011

    Stéphane-M thread starter macrumors newbie

    Joined:
    Jan 11, 2011
    #4
    I don't know if the non-OpenGL parts which interact with Windows are numerous or not, so I won't be able to tell you if the amount of code to be re-written is important or not.

    For Dejo:
    In summary, we would like to find someone who will accept to download the code source of our project, setup in a Mac development environment and try to compile it (rewrite code if necessary, but I ignore if it is a huge work or not) to get an executable for the Mac platforms.
    Our final objective is of course to offer on our website a Windows, Mac and Linux version of our software.
     
  5. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #5
    Also supports standard Posix pthreads, and the C++ STL library. Plus good support for all kinds of image files, good support for Audio, no idea what Glew and OPAL-ODE would be doing.
     
  6. Blakeasd macrumors 6502a

    Joined:
    Dec 29, 2009
    #6
    1. Create a new C++ project in Xcode.
    2. Get the C++ source itself (.cpp) not the Visual Studio Project File
    3.Import the code into Xcode
    4. You will have to import some Frameworks
    =====NOTE=====
    This might not work. It depends on the functions you are using. For example
    windows.h does not exist on the mac. If you get an error it might be because you are using Windows only functions. Be sure to google to errors and look for Mac equivalents.
     
  7. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #7
    Just for the fun of it, I tried importing this code into an Xcode project just to see what would happen. Even after adding the frameworks I felt were probably needed, the initial compile tried compiling 162 files for a grand total of 77535 errors and 2993 warnings.

    It looks like the UI is written using GLUT and various libraries that depend on GLUT. Unfortunately, GLUT is not included with Mac. But it does appear there is a DarwinPorts version of it. So all is not lost. It may be possible to port this with enough effort.

    I'm guessing the way to get this to work is to try and get the GLUT stuff (and this app) to work under X11. It wouldn't be a "native" Cocoa app. Creating a Cocoa version would require re-writing pretty much the entire project.
     
  8. jazzbo macrumors member

    Joined:
    Oct 11, 2008
    Location:
    Bangor, ME
    #8
    To be honest, I haven't used GLUT (or any of OpenGL), but http://developer.apple.com/library/mac/#qa/qa2008/qa1613.html indicates that GLUT is available (and I do see it in the frameworks installed on my machine.)
     
  9. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #9
    Yes it is. Add GLUT.framework. You'll probably need to change the includes from glut.h to GLUT/glut.h though.

    Edit: Balls didn't read the post directly above mine :).
     
  10. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #10
    Wow, I don't know how I missed that. Looks like it might be possible. The Fly program also uses PLIB. The website for that indicates that Mac OS X is "reasonably well supported". So that may take care of a large part of the stuff I couldn't compile since I didn't compile and build that whole library.

    There was some Windows startup code in the program which would obviously have to be re-done. But it's looking like with correct libraries installed, it might not be too hard to get this thing working on Mac after all.
     

Share This Page