Sign in to follow this  
Nima

Multiple platforms (Windows, Mac, Linux)

Recommended Posts

What do companies do to develop an application to support Windows, Linux and Mac-OS (I’m talking about API)? what famous API for those platforms, similar to Win32? 1- Is Carbon the best environment for Mac-OS X? 2- Is X-windows (X11) the best for linux ?(and Is it something like win32 API?) 3- which compiler is the best for linux at the moment ? - I don't think they choose a cross-platforms like wxwidgets for big, critical and commercial projects. we can understand it from their employments (for instance they need win32 and Unix programmer) If you have experience about it, any comments please. Thanks in advance, Nima NF [Edited by - Nima on October 11, 2006 4:34:59 AM]

Share this post


Link to post
Share on other sites
wxWidgets is a very stable and powerful GUI library (its been in development for over a decade), I'm pretty sure that most big companies that want to write cross-platform would use it, otherwise the time and cost of development for them is doubled.

Share this post


Link to post
Share on other sites
Qt should be pretty popular for commercial development, and is IMHO much easier to use than wxWidgets. Not sure, what is the status on MacOS still.
Then Gtk+ and cousins (glib, pango, atk) are very good, IMHO one of the best GUI toolkits available at moment. Not as popular in commercial development as Qt, but still used occasionally.
Both toolkits include platform abstraction part as well, so you should be able to go with almost 100% identical code for all platforms.

Share this post


Link to post
Share on other sites
Personally, I'd recommend going with Cocoa on Mac OS X, and then wrapping it properly. Yes, Cocoa requires Objective-C so that's a bit of a learning curve. If you're reasonably skilled, you'll pick it up in a day or two, and believe you me, after that, writing a game backend is much faster than doing it any other way.

If you choose to go with Carbon, you get a well-known, ill-documented C API that might be more familiar than what you're used to, however. Both API:s are equal in terms of performance and what you can do, as far as you don't do any heavy-duty processing in them, which I guess you won't. :)

Anyway, you're welcome over to http://www.idevgames.com - very friendly Mac developer community. We'll do the heavy lifting for you. ;)

Share this post


Link to post
Share on other sites
Thank you guys,
Have anyone any idea about my Linux questions ?
About X windows (totally/solely development for Linux).

Nima NF

[Edited by - Nima on October 11, 2006 6:58:39 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Nima
Thank you guys,
Have anyone any idea about my Linux questions ?
About X windows (totally/solely development for Linux).

Nima NF
The only time you should even consider touching the X Windows libraries directly is when writing a window manager. If you aren't, go with wxWidgets, GTK+ or QT, then you get platform independence thrown in for free too.

When it comes to compilers, GCC is the only viable option (EDIT: if you're using C or C++, that is). Once again, since it supports all your three targeted platforms, the path to platform independence will be far easier if you use it for all your ports.

As for why companies have both Win32 and *nix coders, even if you use a platform independent GUI framework, there are always some things that need to be done differently. Threads, for example.

Share this post


Link to post
Share on other sites
Quote:
Original post by Valderman
As for why companies have both Win32 and *nix coders, even if you use a platform independent GUI framework, there are always some things that need to be done differently. Threads, for example.


Not totally true, as some framework implement most utilities (Qt has some interfaces to handle threads for example). Anyway, a Windows programmer is unlikely to be as efficient as a Unix programmer when it comes to working on a Unix system. The philosophy of these OS are different, and asking for someone to know how to use all the programming tools in the whole universe is kind of silly. That's the reason why companies that do cross-platform development hire programmers from both worlds, even if they use a cross-platform library with full support for the different OS features.

Regards,

Share this post


Link to post
Share on other sites
My experience is that Qt works and works wonderfully across all three major desktop platforms. I have also had jobs where they relied on Java, but it was my experince that the installation/packaging/deployment issues with Java and the lack of good cross-platform support in Java (something the marketing people never talk about -- "just use JNI" means having to write the interesting stuff in platform-specific C code) causes more work and wastes more resources than just using Qt.

If you stick to Qt, GCC, and the autotools you'll be able to write once, compile everywhere.

Share this post


Link to post
Share on other sites
Thanks I think you are relatively right; but there are two problems that I can’t understand:

1) If those cross-platform toolkits (Qt, wxwidgets,...) are the best choice to use, why don’t all companies use them for their 3D applications or Game Engines?

Do you know anything about developing of these big apps: Unreal Engine 3, Maya, Torque Game Engine or even Adobe Photoshop? (I read in wikipedia that Photoshop use Carbon for Mac-OS X)
For example I found only two famous applications “RealFlow 3“and “Adobe Photoshop Album” that I use is made by Qt, what about other apps?

2) When most of companies want to employ some programmers, they need C/C++ coders (and sometimes with experience of win32), so why don’t they employ experienced coders under Qt or wxwidgets? If employees don’t have any experience with those toolkits, and just know Win32, How they can learn and use them without difficulty? How can we work in a team with something that we didn’t touch before?

Thanks in advance

[Edited by - Nima on October 13, 2006 2:35:49 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Nima
1) If those cross-platform toolkits (Qt, wxwidgets,...) are the best choice to use, why don’t all companies use them for their 3D applications or Game Engines?

Lowest common denominator. A cross-platform toolkit, in order to maintain a clean and simple API, must support only features that are available across all of its target platforms. Otherwise it has to introduce conditional compilation branches, different internal implementations to emulation functionality available here but not there, and this makes the overall package less desirable because the perception of simplicity is lost.

Quote:
2) When most of companies want to employ some programmers, they need C/C++ coders (and sometimes with experience of win32), so why don’t they employ experienced coders under Qt or wxwidgets? If employees don’t have any experience with those toolkits, and just know Win32, How they can learn and use them without difficulty? How can we work in a team with something that we didn’t touch before?

If you know Win32, you can fairly trivially pick up a toolkit that abstracts Win32. You understand what it's trying to do underneath, and you may even appreciate the areas where it saves you work. (Go implement ReBar controls in straight Win32. [smile])

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
Lowest common denominator. A cross-platform toolkit, in order to maintain a clean and simple API, must support only features that are available across all of its target platforms. Otherwise it has to introduce conditional compilation branches, different internal implementations to emulation functionality available here but not there, and this makes the overall package less desirable because the perception of simplicity is lost.

wxWidgets doesn't really follow the lowest common denominator approach - it has certain flags that are ignored on most platforms (e.g. wxTextCtrl lets you choose to use the rich text control (Win32 only), or right-align text (Win32 and GTK2), or wrap text at characters instead of word boundaries (GTK2), or capitalise the first letter (PocketPC/Smartphone)), and it has certain requirements that are relevant on some platforms (e.g. brush stipples must be 8x8 bitmaps on Win95), and certain classes that implement the same interface but act very differently (e.g. wxConfig is mapped to wxRegConfig (registry) on Windows, but wxFileConfig (INI-like files) elsewhere). The API appears to be limited to fairly small differences - the major features are the same on all platforms, and emulated where necessary (e.g. there's a Win32 tree control implementation plus a generic tree control for everywhere else).

The documentation seems to be good at pointing out the platform-specific features and differences, so you can write portable code when you want to. It still gives you the option to tailor the design differently to suit different platforms, which is nice (and also necessary if you want to create a high quality program, because users of different platforms expect different designs). You do have to understand what you're doing if you're writing applications for multiple platforms, unlike the run-anywhere philosophy of AWT/Swing, which is balanced against getting a more native feel on each of those platforms. Whether the API suffers from a lack of simplicity is probably a matter of taste - the cross-platformness doesn't seem to cause me problems, but I've been working mostly on Windows (which is probably the most favoured platform of wxWidgets) and the only applications I've ported to Linux have been fairly simple ones, so I don't have much experience to judge whether it works well in practice or not. Still, I much prefer it to most of Java's attempts at cross-platform GUIs [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by Excors
Quote:
Original post by Oluseyi
Lowest common denominator. A cross-platform toolkit, in order to maintain a clean and simple API, must support only features that are available across all of its target platforms. Otherwise it has to introduce conditional compilation branches, different internal implementations to emulation functionality available here but not there, and this makes the overall package less desirable because the perception of simplicity is lost.

wxWidgets doesn't really follow the lowest common denominator approach - it has certain flags that are ignored on most platforms...

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
Quote:
Original post by Excors
Quote:
Original post by Oluseyi
Lowest common denominator. A cross-platform toolkit, in order to maintain a clean and simple API, must support only features that are available across all of its target platforms. Otherwise it has to introduce conditional compilation branches, different internal implementations to emulation functionality available here but not there, and this makes the overall package less desirable because the perception of simplicity is lost.

My (attempt at a) point was that I don't think that cross-platformness necessarily makes the API less clean and simple, or that it necessarily harms the "perception of simplicity". The complexity can be hidden behind the API and you'll never see it if you stick to a single platform - you can still write Windows-only programs using Windows-only features, without it being less simple or less powerful than in a Windows-only toolkit; and you can write GTK+ programs using GTK+-only features in almost exactly the same way, with the only difference being that you ignore parts of the documentation that say "Win32 only".

You do see some of the necessary complexity when actually trying to support multiple platforms in your application - but if it's no worse than a single-platform toolkit when you're targetting a single platform, and it has the benefit of leaving open the opportunity to support another platform for relatively little cost later, it would be a sensible approach.

The cross-platform toolkits' APIs might happen to be worse than that of some single-platform toolkits (e.g. the best tools and libraries are only available on Windows, or only on OS X, or whatever), but I would believe (unless convinced otherwise) that's simply because they're not as well designed, and not because of fundamental complexity which is required of any API for a cross-platform toolkit.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Nima
Do you know anything about developing of these big apps: Unreal Engine 3


Unreal Engine 3 uses wxWidgets.

(There was a small game demo release a while a go; RoboSomething - Intel demo, and if you have a look in the binaries folder you can see that there are wxWidgets DLLs that are being linked in)

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Quote:
Original post by Nima
Do you know anything about developing of these big apps: Unreal Engine 3


Unreal Engine 3 uses wxWidgets.

(There was a small game demo release a while a go; RoboSomething - Intel demo, and if you have a look in the binaries folder you can see that there are wxWidgets DLLs that are being linked in)


Could be for supporting tools, as opposed to being in the game engine itself.

Share this post


Link to post
Share on other sites
Quote:
Original post by grekster
Quote:
Original post by Anonymous Poster
Unreal Engine 3 uses wxWidgets.

Could be for supporting tools, as opposed to being in the game engine itself.

From a message two years ago: "We've already rewritten UnrealEd to use the wxWindows toolkit on Windows. The intention is to have it run on Mac, Linux, and Windows. That's for UnrealEngine3, though, not UT2004".
It seems possible that it could be used by the engine too, e.g. for the startup and configuration dialog boxes, though those aren't particularly interesting compared to UnrealEd.

Share this post


Link to post
Share on other sites
Quote:
Original post by Nima
What do companies do to develop an application to support Windows, Linux and Mac-OS...


I use Java.
Considering Java has strong core libraries, and ability to detect windowless environment, followed by an ability to create your own limited "widgets" without worrying about what OS are you using, or other OS specifics, it works flawlessly for 2D games.
For 3D games I use Java and OpenGL.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this