Hi. Well, the past year, I have spent learning GUI programming in Java and have created several games (Asteroids, MineSweeper, TicTacToe, etc, etc) in Java.

I was wondering if there is an easy way (is it easy at all?) to go from what I know about GUI programming in Java, and begin converting what I have from the ground up in C++.

Things that I am worried about:
1.) No automatic garbage collection.
2.) Libraries.
3.) Sources for help if I get stuck and can't figure things out.

Garbage Collection: I have taken a class that was mostly Java but we did do some C++ programming as well, so I am confident I can do memory management (or at least learn it quickly) if I need too.

Libraries: What do I need to know? Does the C++ standard library give me everything I need for GUI programming like Java? I've never had to worry about a library before, so if C++ doesn't have what I need, what should I do? Is there some kind of standard?

Help?: For Java, there is an extensive array of API documentation that I could use to find out things quickly. I also use the Eclipse IDE which automatically shows all the available methods I could use in all Java classes which made it extremely easy for me to learn on my own. Are there any recommendations for such an IDE like Eclipse, for C++ that allows quick aid while I'm programming? Also, API documentation for C++?


Also, I am wondering, are the methods used for GUI programming similar to Java? For example, creating a JPanel in a JFrame in Java: would it be similar in C++?

Thanks for the help!
-TheWhite

I would use a c++ library such as DirectX or OpenGL that does all the difficult GUI stuff for games. There are lots of tutorials.

c++ is not good at browser stuff, like Java. C# is better than C++, but for browsers java IMO is better than either of them. win32 api has functions similar to JPanel in a JFrame, but you may not need them with DirectX or OpenGL.

First, if you want an IDE like Eclipse for C++ on Windows, you can do a couple of things: 1) use Eclipse - it has a C++ developers perspective you can use to code in C++. It can be set up to use Microsoft's C++ compiler or GNUs (via minGW or Cygwin), or 2) Microsoft has a free version of it's C++ IDE (Visual C++ Express 2008, available here).

Microsoft's Visual Studio has the same sort of stuff that Eclipse has, as far as syntax coloring for code, and what Microsoft calls "intellisense" - where you hit the dot or (->) and a list of methods and properties shows up for the object you're using.

As far as garbage collection is concerned, it depends on what environment you use. If you use the .NET environment (managed C++, C# or VB.NET), you do get garbage collection, but most game programming is done in unmanaged C++ (like the old days). No garbage collection with unmanaged C++ - that's your job.

Help if you get stuck - a lot of folks use C++ - shouldn't be an issue.

Libraries - there's a game developer kit called DarkGDK that is free-to-use (check site for details!) library that wraps up a lot of "standard" gaming code, and it works with Visual C++ Express 2008. Their site is here. The DarkGDK uses DirectX for the low-level graphics stuff.

Or you can use OpenGL. There's a free library on SourceForge called G3D that uses OpenGL as the basis for the graphics code, and it's available on many platforms.

Great. Thnx guys. You put me right on track.

As far as the libraries (wew!) -- that's the sound I make when I'm overwhelmed, but that's a good thing :).

I think I'm going to start a little smaller though in terms of software creation (instead of game) and see what I can find..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.