C++ cross-platform graphics library?
Does anyone have any recommendations for a cross-platform compatible, C++ graphics library? I've played around a bit with wxWidgets, QT, and Allegro, and was wondering if any of them are worth actually learning. Has anyone used Irrlicht or any other graphics library that you would recommend? Should I even bother learning any of these, or should I just stick with some OS specific graphics library (although the thought makes me die inside a little)?
I have really only used QT and find it to be quite powerful (as do other large companies, apparently). It is fairly easy to learn and isn't too inefficient when it comes to execution time.
Quite frankly, what it comes down to is what you are going to be using it primarily for. Simply window forms? Or Animation forms? Or what?
You can google around to find the best uses of each library. WxWidgets has a nice little "compare to others" wiki up:
http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits
I would like a library with the simple window forms just for playing around with code (I just write random programs, like the cash register program I'm writing), but my primary purpose is for creating games. I would probably be better off using Java for platform independent coding, but I never really cared much for Java. I don't like the implicit pointers and lack of unsigned data types, but I guess that could be a good option, too…
OpenGL is definitely a good choice for games because it is powerful, fast, and fairly easy to do simple things (although it can get quite a bit more difficult to do more complex things (no duh)).
I would highly suggest not using Java for coding games. There is a very good reason why you do not see many games written in Java. Although I would not cite the lack of "unsigned" as the reason* (or any other one specific thing), certain languages just have their strengths and weaknesses. Java is great for cross-platform, simple application development. Processor heavy or graphic heavy (or even "light" in some cases) applications do not run well in Java by nature. For games, I would recommend a more complex, OS specific language (such as C, C++, etc).
If you really want to code cross-platform applications, I highly suggest C# (I have recently taken a liking to it). It can execute at fast speeds (especially with certain optimization compilers), is easy to code (and read), and is becoming more and more cross-platform (even though its .NET, a lot of people don't realize .NET is cross-platform). There are some significant games that are written in C# (some XBox games, etc). Even a version of Quake was written in C# to show off its power!
To me, it sounds like you are in more of a debate about "which language to use" instead of "which library" to use. Focus on a language, and then narrow in on a library.
I hope this helps.
- = Unsigned datatypes aren't actually required to do standard operations in Java. This website can give you an idea about that: http://www.javamex.com/java_equivalents/unsigned.shtml
With OpenGL, I'll still need to manage the windows, won't I? And as for C# and .NET, I have a very strong aversion to anything Microsoft (though I will admit I never knew .NET was cross-platform). This is part of why I want cross-platform. While I personally don't like Microsoft technology, the majority of people do, or at least use it with a minimal of complaints, and I want my code to work for the anyone who would be interested, regardless of their OS preference. Regardless, I want portable code, so I'm willing to learn if it seems to be the best option, though I really want to stick with C++, as that's the language I'm most familiar with.
Another library that does work on many platforms is GTK but this doesn't simplify anything more than QT or wxWidgets / insert facvourite windowing thingy-ma-doo-hick-here.
You can always go for SDL since that supports OpenGL, will work cross platform, doesn't have window specifics which allows you to write a graphical application that doesn't require any windowing specifics. However it does not have standard controls like you would expect of QT, GTK / whatever.
Jim,
Yes, with OpenGL, you will still have to manage the windows. There are some utilities/libraries that can make it easier (like GLUT for OpenGL), but generally any library that has more power and capabilities than you need will be too inefficiently complex for your needs (if that poorly worded sentence makes sense).
While I would generally agree with you about Microsoft products, I must say, their C# .NET development has been pretty damn good. I am definitely a Linux, open source, anti-Microsoft fanboy, but C# does so many things right and it actually makes me happy to program again (happy in the sense of: its not unusually difficult to do something easy and simple, but its not dummed down to the point of lack of applicability). And yes, a LOT of people don't know that C# .NET is cross platform now (due to open source development (Google "mono develop" and you will see). You can even write iPhone applications and the like in C# now! In my experience, C# is definitely the underdog in programming languages, but it is definitely something to take a look at.
Also, you do have to take into account that if you are planning on making a full-fledged game, most people (read: all) will be using Windows to run it. While it is great to make a game cross-platform, it is always better to code it with a sight on one specific OS and THEN mess with it to get it to work on other platforms. Because C# is a Microsoft creation and obviously Windows is as well, they work very well together. Due to the open source community, most (read: all but a few small things) C# code that works on Windows will work on Linux and Mac just as well (possibly some inefficiencies, but you have to make sacrifices)!
You can definitely stick with C++ if thats what you are most comfortable with! Don't let me talk you out of that at all. OpenGL is a fantastic library with some fantastic tutorials and documentation for C++.
OpenGL is used more for games (3D and 2D), virtual reality, etc. GTK and QT are for more graphical user interface programming. In my experience, Qt is way more portable and cleaner to use. I will let you decide:
http://www.wikivs.com/wiki/GTK_vs_Qt
I hope I am helping you with this decision :-)
Please note: I only have experience with OpenGL and Qt. I have personally never used GTK so I cannot speak from experience with it.
I never got a chance to try out SDL. I meant to, but didn't get around to it. I've always heard that GLUT is really only useful for trivial programs and for learning OpenGL in a cross-platform environment, specifically not needing to learn OS specific code to learn OpenGL. I've looked around at some c# code, and it kind of looks like a mix of java, c++, and python, from the limited sample I've seen. actually, doesn't .NET work with c++? Visual c++ is basically the same thing, isn't it?
C# is mostly a mix of C++ and Java.
Yes, there are tons of other .NET languages (http://en.wikipedia.org/wiki/List_of_CLI_languages), but C# is the most used CLI language. C# was designed for CLI instead of designing the CLI for the language (like C++, etc), so you can imagine that it has perks when using C# in the .NET environment.
I would have to seriously call bullshit on that article. Not only do I not believe that that will ever happen, it amazes me that it doesn't warn about other languages that Microsoft has invented (or reinvented) or the .NET framework in general (which is already largely in use). The uproar from a move to patent it would be devastating to many, many applications and development companies.
In addition, a language named "Vala" is in the early stages of development to mimic C# in almost all ways.
To ignore a great language because of a baseless fear is ridiculous.
Raikia wrote: I would have to seriously call bullshit on that article. Not only do I not believe that that will ever happen, it amazes me that it doesn't warn about other languages that Microsoft has invented (or reinvented) or the .NET framework in general (which is already largely in use). The uproar from a move to patent it would be devastating to many, many applications and development companies.
In addition, a language named "Vala" is in the early stages of development to mimic C# in almost all ways.
To ignore a great language because of a baseless fear is ridiculous.
You obviously didn't read the article.
Definitely SFML!