Jump to content

The "Being a Game Programming Newbie" Handbook

programming c++ game directx language windows want opengl choice
Covers some essential first steps for new programmers.

4: Adsense


I will be honest with you: I am getting sick of your average newbie. "What books should I get?" "How long until I can make _______ (famous game name)?" "I want to make an RPG!" "Tell me how to make a game!" Well kids, those might be questions that you have, but don’t go up to a respected programmer and ask them any of the previous… Well, unless you feel like being laughed at and made fun of.

Basically, all of these people you see, making the "big games." Yeah well, those people didn’t get there by using "RPG Maker," or "Klik and Play." They put some serious work into learning a computer programming language (C, C++, Assembly, Visual Basic, etc…). Then when they had a language down pat, they put some more serious work into learning an application programming interface (more commonly known as an API) with two of the most famous being OpenGL and DirectX. So, if you are interested in doing some serious reading, learning, and listening, you too can be on the road to making the next "big game," but it's not easy. This article is not going to teach you how to program, but it will give you the right steps to becoming a good programmer.

A Language

There is no set "best language," though most of the industry either uses C, C++, or a mix of the two. Most people say that you should learn C before C++, though I tend to disagree. I learned C++ with no prior programming experience, except for some BASIC about 4 years before I started. I prefer C to C++ however, I like how easy it is, and how fast it is. Perfect for game programming. But whatever floats your boat will work. Here is some recommended reading for C++ readers in order of difficulty:
  • The Waite Group’s C++ Primer Plus by Stephan Prata
  • The Waite Group’s Object Oriented Programming in C++ by Robert LaFore
  • Thinking in C++ by Bruce Eckel (this is more for programmers who want to convert from C to C++, it has some interesting coding tips for C++ coders too
  • Effective C++ by Scott Meyers
  • More Effective C++ by Scott Myers
  • The C++ Programming Language by Bjarn Stroustrup (C++’s creator)
And for those interested in learning C:
  • C by Example by Greg Perry
  • The C Programming Language by Brian Kernighan and Dennis Ritchie
Those are the only two books for C that I have heard good results from. I am not saying that there aren’t any other good C books out there, but I have heard good things about them.

Once you have read up, and practiced your language of choice for about 3-4+ months, I want you to try to program a complete text game. It can be any type of game. And you must implement the following features: structures/classes (for C/C++ respectively), file input/output, pointers, game logic, all original code, and if you are doing C++, you might want to practice some of the more complex class techniques such as Polymorphism, Inheritance, Abstract classes, virtual functions, etc…

Once you have created a game, and had no problems what-so-ever, you are ready to now move onto Windows programming.

Windows Programming

Windows programming can seem a bit daunting at first, but trust me, once you read for a while, and are able to recognize all the functions, you will be fine. And, to keep consistent, here is some recommended reading for you. The choices are a wee bit thin, but these are great books:
  • Tricks of the Windows Game Programming Gurus by Andrè LaMothe
  • Windows Game Programming for Dummies by Andrè LaMothe
Wide variety of choice for the authors, eh? Well, the Dummies version of the book is basically a "lite, diet, whatever you want to call it" version of the Gurus book. These books both provide extensive coverage of Windows programming, and meanwhile making it fun to read too!

Once you have the basics of making a window down (hehehe… ), it's time to move on to Windows' Graphics Device Interface (GDI). The GDI is basically a really great "API" for business applications, or other apps that don’t require extreme speed, or sound at all. You should learn how to use it anyway though, because it gives you some insight on moving into the API of your choice. It is perfect practice, and also gets you used to graphics programming. For this "exercise" I would like to see you make a Pong, Tetris, or similar game of your choice. Have fun.

The Dark, Scary World of APIs

MWAHAHAHA! Okay sorry, I feel better now. This is where things start to get really fun. ^_^ This is where one of the bigger choices comes down to. You basically have a choice of two major APIs. DirectX, which has 2D, 3D, Input, Sound, Music, and Internet Support) or OpenGL (which is absolutely perfect for 3D games. Quake was made in OpenGL, and if you haven’t heard of Quake, how on Earth did you find this article?). It isn’t really that much of an Earth-shattering decision. More of matter of preference. You will probably be learning some parts of DirectX no matter what though (another example of Microsoft’s strangle hold on the world), as OpenGL doesn’t have and Input, Sound, or Music support. And though OpenGL is made for 3D, it can also be used in 2D, though it’s 2D capabilities are not as great as DirectX’s DirectDraw for 2D.

I may sound pro DirectX up there, but DirectX also has its share of flaws. First of all, it is incredibly hard to learn, and master. I have read Tricks of the Windows Game Programming Gurus’s section about DirectDraw about 7-8 times, and I still don’t get it. In fact, as I type this I just printed out 37 pages of the DirectX SDK help file to learn from. The absolute best book on DirectX in my opinion is LaMothe’s TOTWGPG by far. It is also my game programming "bible" for many things, such as AI, and physics.


It's that time to say good-bye kiddos. By now, you should be a Window’s expert (can we say oxymoron?) and should be moving your way into DirectX or OpenGL. Feel free to mail me at any time. It can be about this article, future requests for articles, some progress you have made, a section of code you would like me to check out, venting about how your dog died… My address is ShiningKnight7@hotmail.com. I really don’t care what its about, I just love to hear from people!

And if you get anything from this article, anything at all: please, don’t ask dumb questions, expecting to get smart answers. Most questions aren't dumb, but if you want to hear some dumb ones, just re-read the opening paragraph in this article. Happy coding!


/ Jorge Bustos
Jun 08 2012 07:07 AM
Thanks, Trent.

With this article you have helped me avoid a couple of embarrasing questions and moments. You have also enlightened me on the subject of game programming. I currently give IT classes at a Mexican Highschool, UVM Campus Monterrey and some of the kids do make those questions and wish to develop games. On a personal note, I DO NOT consider myself a programmer though I use VBA code for Macros and, alas, never gave a thought to game developing.

Needless to say, your artlcle put everything in correct perspective and provided me with the necessary information for me and my students. Thanks for enlighting those of us who are curious on the subject and "keeping it real". Best regards.
/ fir
Oct 09 2013 02:52 AM

yes, this is quite correct, (I share this point of view like here above too), though it could be said that today there are many ways of building computer game not only c -> winapi -> ogl/dx 

(though accidentaly this is my personal way of choice)


At a side of learning GDI point there is probably a good point to interest self in some common libraries like allegro sdl or sfml, (accidentaly I was not using them (yet?), but looking at them is worth doing

Note: GameDev.net moderates article comments.