Dark Bit Factory & Gravity

GENERAL => General chat => Topic started by: Pixel_Outlaw on June 10, 2011

Title: Advice on making cross platform software?
Post by: Pixel_Outlaw on June 10, 2011
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.
Title: Re: Advice on making cross platform software?
Post by: padman 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 (http://www.purebasic.com/download.php)
Title: Re: Advice on making cross platform software?
Post by: ferris on June 10, 2011
From what I've seen, relying on SDL (http://www.libsdl.org/) 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 (http://www.codeblocks.org/) 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 :) .
Title: Re: Advice on making cross platform software?
Post by: ferris 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 :)
Title: Re: Advice on making cross platform software?
Post by: TinDragon 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
Title: Re: Advice on making cross platform software?
Post by: hellfire on June 10, 2011
QuoteI'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 :)
Title: Re: Advice on making cross platform software?
Post by: ferris on June 10, 2011
QuoteThe best way to overcome the "uneducated person" thing is to fall into as many pitfalls as possible :)

Rules :D
Title: Re: Advice on making cross platform software?
Post by: zawran 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.
Title: Re: Advice on making cross platform software?
Post by: Pixel_Outlaw 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.
Title: Re: Advice on making cross platform software?
Post by: zawran on June 10, 2011
QuoteI'm being pulled towards Java

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