Author Topic: Advice on making cross platform software?  (Read 6024 times)

0 Members and 1 Guest are viewing this topic.

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1390
  • Karma: 84
    • View Profile
I don't know how many people out there have worked on cross platform productions but I bet a few have.
Since starting to use Linux I really want to make cross platform games and demos.

I'm sure there are plenty of gotchas and pitfalls that an uneducated person could fall into.

My main targets would probably be Windows, Linux and Mac personal computers.
I currently use SFML for most C++ work.

How does one avoid getting locked into a language like C#, VisualBasic and the like?
What languages and libraries should I steer away from?

Just asking for some advice on where to point myself for future plans.
« Last Edit: June 10, 2011 by Pixel_Outlaw »
Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Advice on making cross platform software?
« Reply #1 on: June 10, 2011 »
I don't think you wanna switch from C++ to Purebasic, but just for the record you can write stuff that compiles on Windows, Linux and MacOSX with it, if you avoid OS specific commands like the WinAPI for example. Shouldn't be a problem for games and demos, although some more elaborated commands might not work the same on all platforms. (3D sprites for example use DirectX on Windows and OpenGL on Linux...)

Anyway, if you wanna check it out, there's free demos with very few limitations available at: http://www.purebasic.com/download.php
Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Advice on making cross platform software?
« Reply #2 on: June 10, 2011 »
From what I've seen, relying on SDL always works, just may have to include a library with your prod here and there (no big deal). OpenGL is clean, too, as I'm sure you know. For C++ you can still write in Visual Studio, but be aware that there are some minor code differences between M$'s (seemingly standard but quite domain-specific) idea of C++ and the rest of the world's ;) . I would recommend switching to GCC in this case; there are plenty of great IDE's available like Code::Blocks so you won't be far from a comfortable environment.

Codewise, if you limit yourself to STL and SDL/OpenGL/Qt/Only libraries that are explicitly cross-platform, you'll be just fine :) .
« Last Edit: June 10, 2011 by Ferris »
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Advice on making cross platform software?
« Reply #3 on: June 10, 2011 »
Just checked out SFML a bit; seems it's cross-platform as well (AND has Code::Blocks bindings!). Looks like you're all set :)
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: Advice on making cross platform software?
« Reply #4 on: June 10, 2011 »
Well C++ with a cross platform api like sdl seems a common way people go, there are other api's not sure if SFML has a linux version. The biggest headache will be making something on linux that works for other linux users who might be on a different distro or have crappy gfx drivers etc. this is were using one of those api's can help out :)

As a blitzmax user you already have a pretty decent crossplatform language that can do almost anything you need so I wouldnt go looking for another language. Between bmax and c/c++ your pretty much covering anything you could want to do, bmax works well on the linux distro's I have tried it on, I havent ever tried doing any c++ coding on a linux box but I would probably use something like sdl to handle the window and gl setup stuff to make life abit easier  ;)

[Edit] Seems Ferris beat me to it :P

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Advice on making cross platform software?
« Reply #5 on: June 10, 2011 »
Quote
I'm sure there are plenty of gotchas and pitfalls that an uneducated person could fall into.
The best way to overcome the "uneducated person" thing is to fall into as many pitfalls as possible :)
Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Advice on making cross platform software?
« Reply #6 on: June 10, 2011 »
Quote
The best way to overcome the "uneducated person" thing is to fall into as many pitfalls as possible :)

Rules :D
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Advice on making cross platform software?
« Reply #7 on: June 10, 2011 »
Blitzmax should enable you to do just about anything you would want on three platforms. And you already have it and have experience with it, so it might be worth looking into again. You can combine C and C++ with Blitzmax, a lot of people already does.

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1390
  • Karma: 84
    • View Profile
Re: Advice on making cross platform software?
« Reply #8 on: June 10, 2011 »

Thanks for the advice.
Currently I use Code::Blocks compiling GCC with SFML.

For some unknown reason, I'm being pulled towards Java too since it is getting quite popular...
I hear it is very portable yet almost none of my programming friends whom I've talked to have a very high opinion of it.

@Hellfire
I really think you have hit the nail on the head.
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Advice on making cross platform software?
« Reply #9 on: June 10, 2011 »
Quote
I'm being pulled towards Java

I they can make MineCraft in in then its probably good enough for games and more.