Cross platform development

Discussion in 'Indie Basics' started by StefanM, Feb 3, 2005.

  1. StefanM

    Original Member

    Joined:
    Jan 16, 2005
    Messages:
    7
    Likes Received:
    0
    I would like to support multiple platforms for my games, at least windows and mac. What do i have to think about?

    Are there any good information online for cross platform game development with open gl maybe? I plan to program in c++.
     
  2. GBGames

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    1,255
    Likes Received:
    0
    OpenGL is cross-platform. The only thing you need to worry about are the operating specific initialization, such as wgl for Win32.

    SDL is also cross-platform.

    gcc is cross-platform. Look into the ports mingw for Win32 and xcode for OS X.

    Unfortunately most game development discussion is Windows specific. However, for Mac game development, you can look at Apple's game developer resources. Also, if you don't want to work on the Mac yourself, Red Marble Games can offer to handle the porting for you.
     
  3. ggambett

    Moderator Original Member Indie Author

    Joined:
    Jul 26, 2004
    Messages:
    1,982
    Likes Received:
    6
    I develop on Linux and sell on Windows and Mac, from a single code base. The short story : I use SDL and gcc on all platforms. Search my old posts, I'm sure I explained what I do before with much more detail :)
     
  4. Ryan Clark

    Indie Author

    Joined:
    Oct 29, 2004
    Messages:
    656
    Likes Received:
    0
    I'm using SDL for my game, too... it is truly excellent. I've been testing my builds constantly on Linux, MacOSX, and Windows, and haven't had a single problem.

    Over on the game programming wiki we've got some SDL Tutorials, if you're interested in learning more.

    If you're on Windows, you can download Dev-C++ for free (a C++ IDE which uses gcc/g++ for compilation). Other platforms also have free IDEs which work well with SDL.
     
  5. Greg Squire

    Original Member

    Joined:
    Aug 5, 2004
    Messages:
    848
    Likes Received:
    0
    You might want to look into using an engine or SDK that is cross platform, such as PTK or Torque(if you need 3D). BlitzMax is now out and it's now crossplatform, however it's basic (not C++), but still very good. The Win32 version is still in beta and a 3D module is underway.
     
  6. Sybixsus

    Original Member

    Joined:
    Aug 2, 2004
    Messages:
    959
    Likes Received:
    0
    Is Torque on a Mac actually any good? I've heard ( and witnessed ) some pretty patchy results with Torque on Windows. I've seen it running quite well on moderate PC's and then again I've seen it running like a dog on a pretty high spec PC. But the only people I know who have witnessed the Mac version say the performance is horrible.
     
  7. Ciperl

    Original Member

    Joined:
    Jan 12, 2005
    Messages:
    38
    Likes Received:
    0
    I'm having a blast working with Torque on my dual G5 2.5

    Not sure what you mean by "horrible performance". Maybe if you had some more specifics about performance issues I could help your friends with some tips that I have found on the Mac.

    But besides that, there are a bunch of studios working with Torque and the cross platform issue is a huge selling point. One Story: the guys over at BraveTree (ThinkTanks, etc.), they brought a game dRacer to IndieGamesCon last October. The game was only on Windows when they arrived. They saw that Apple had loaned IGC twelve awesome G5s with huge cinema displays. So they went home of Friday night worked on the game. The next morning (Saturday), before IGC started they installed a full Mac version of dRacer on all the machines... Talk about cross platform. Because of the functionality of Torque they were able to completely port their racing game over to Mac in less than a night. Plus some of the performance was even better on Mac.

     
  8. Sybixsus

    Original Member

    Joined:
    Aug 2, 2004
    Messages:
    959
    Likes Received:
    0
    I don't think they were developing. Just trying out the engine and maybe some other people's demos. They didn't offer anything more specific than horrible performance in everything they tried.
     
  9. Evak

    Original Member

    Joined:
    Aug 3, 2004
    Messages:
    100
    Likes Received:
    0
    hmm, torque is slow on the low end athlon1200 geforce 3 I have. Also all the games look pretty dull due to poor lighting and dated rendering engine which doesn't support much in the way of multitexturing. The newer shader version looks a lot nicer but it still has a lot in common with old torque somehow, and is slower than I expected, although I'm not going to make final judgement on it till its out of beta.

    I'm currently using blitzmax, we wrote a 3D module of our own in a little over a month, currently working fulltime on a indie sports game. If your interested you can check out a .WMV video I made yesterday 4mb.

    http://s93153354.onlinehome.us/rifa2.wmv


    still early days yet, been working on the game for 2 weeks but blitzmax is proving excellent, and the game runs pretty fast. On antonys Pentium 2 350 with a 5200FX about 55FPS.

    Currently were not using any shaders or extensions, just the basic multitexture blend modes, and were hoping to get good openGL compatibility, allthough we havent tested on many systems yet. Blitzmax isn't really what I'd call basic in the traditional sense though. It's more like C++ with a streamlined commandset tailored towards games so you can write games a lot faster.
     
    #9 Evak, Feb 4, 2005
    Last edited: Feb 4, 2005
  10. Teeth

    Original Member

    Joined:
    Dec 6, 2004
    Messages:
    165
    Likes Received:
    0
    /inserts obligatory Java comment

    Java is cross-platform to beyond Windows, Mac and Linux, and there is more than one wrapper for OpenGL for Java, too.
     
  11. princec

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    4,873
    Likes Received:
    0
  12. Gnatinator

    Original Member

    Joined:
    Nov 23, 2004
    Messages:
    357
    Likes Received:
    0
    For more variety you could also give Allegro a try. Allegro supports DOS, Unix (Linux, FreeBSD, Irix, Solaris, Darwin), Windows, QNX, BeOS and MacOS X. It also compiles on a large variety of compilers.

    If you want OpenGL for graphics, be sure to check out AllegroGL. AllegroGL is still in its infancy on the Mac platform, but its still pretty decent (I am currently using it in my project).

    If you have any questions, be sure to visit the community forums.
     
  13. milieu

    Original Member

    Joined:
    Jul 26, 2004
    Messages:
    88
    Likes Received:
    0
    Ogre

    Ogre is a C++ 3d graphics engine which runs on Windows, Mac, and Linux. The 1.0 version is coming out sometime this month.
     
  14. stan

    Original Member Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    188
    Likes Received:
    0
    Obviously, you have to use technologies that are available (and working) on all the target platforms. If you use C/C++, the standard C library functions, and cross platform input/output libraries like SDL and OpenGL, the only thing you have to be careful about is endianness (byte ordering is different on x86 and on PPC).
     
  15. ggambett

    Moderator Original Member Indie Author

    Joined:
    Jul 26, 2004
    Messages:
    1,982
    Likes Received:
    6
    Indeed, what took me 4 hours to port my codebase from x86 to Mac was identifying and fixing the endianness issues in the Stream classes. I'll state the obvious : endianness is an issue only if you save chunks of memory and read them in the other platform (ie fwrite(&pStruct)) or access them in memory. Everything else should Just Work (TM).
     
  16. super_mario

    Original Member

    Joined:
    Feb 4, 2005
    Messages:
    4
    Likes Received:
    0
    I simply just implement the core components that I will be using for my game for each platform. This might be a graphics object, a sound object, and the interface for the game. Once you do that just have the game interact with those components. If you want to port the game all you have to do is implement those components for another platform. This has help me.
     
  17. stan

    Original Member Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    188
    Likes Received:
    0
    Oh, another thing you might want to remember is that standard Mac mice have only one button :]. (grrrr)
     
  18. GBGames

    Indie Author

    Joined:
    Jul 27, 2004
    Messages:
    1,255
    Likes Received:
    0
    Regarding BlitzMax: it is only cross-platform on the Mac at this time. B-) They plan on porting to Win32 and Linux, but haven't released anything for it yet.
     
  19. Evak

    Original Member

    Joined:
    Aug 3, 2004
    Messages:
    100
    Likes Received:
    0

    Actually GB the PC and linux versions are in late beta and you can use them if you purchase the Mac version, so you get all 3 versions with the purchase of one. The game engine were making is cross platform allthough we use primarily Win32. Bmax seems to be really good considering its only been out for aproximately 6 weeks). For a beta it's very stable indeed, you can compile the same source code on any of the 3 platforms. Can even compile the mac version on the PC via PearPC if you really want to. Not that I'd recommend it.
     
    #19 Evak, Feb 6, 2005
    Last edited: Feb 6, 2005
  20. Indiepath.T

    Original Member Indie Author

    Joined:
    Sep 4, 2004
    Messages:
    329
    Likes Received:
    0
    I second that one Evak. I too have the BMax win32 Beta and find it an excellent piece of software.

    I'm also looking forward to "Trinity" so that I can switch our development full time to the BMAX platform and release on Linux,Win and Mac.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer