Game Programming Books

This is a discussion on Game Programming Books within the Game Programming forums, part of the General Programming Boards category; I'm wanting to learn some 2d/3d DirectX/OpenGl Graphics, and am looking for a good book. I'm using Borland C++ Builder ...

The number one book I and everyone I know love the most is Tricks of the Windows Game Programming Gurus by Andrew Lamothe. It's a pretty thick book and totally utilizes directdraw and goes over other directx features such as directmusic, directinput and directsound.
It only teaches ideally for VC++, though. taught me a lot about directdraw although i never really made a game from directx that was worth sharing...
Anyway it explains everything perfectly. It even comes with some CD's with VC++ introductory edition and Caligari Truspace. Good stuff if you like directx.

The reason why that book would be more taylored to VC++ is because VC++ is made by Microsoft...they tend to stick with their own kind. Lamothe's book isn't a great tool for learning an API. It is a wonderful book, but it only uses aspects of DirectX that it needs in order to get the main points across.

If you're looking for an OpenGL book to start off with, I would suggest "OpenGL SuperBible." It's wonderful to start off with since most of the book works with the glu library and gl functions that are gaurenteed to be portable. Then towards the end, it goes into Windows platform specific stuff. The authors have great street cred as well. They've been with OpenGL since the beginning, and helped in writing the OpenGL specifications. I think the book is on its third edition now.

I would also suggest focusing on one at a time. Both are very different from each other on several levels.

Whether OpenGL or DirectX is better is strictly a matter of opinion. However, OpenGL is typically easier to learn if you are a beginner.

As a side note, I own OpenGL SuperBible, and I do not really like it all that much. The book I started out with was OpenGL Game Programming. So, I own both, and I endorse OpenGL Game Programming. Plus, you can visit Gamedev.net, which is the site setup by the authors of the book. I've sent emails to the author of the book, so I like that setup more.

OpenGL is much easier to learn than DirectX, so I would also suggest to go with that as vNvNation said. COM objects (the building blocks of DirectX) can be quite confusing and difficult to work with at times. John Carmack also has some humerous opinions on DirectX.

Run the program and it extracts all of the files to the directory you downloaded it into.

Put the headers and libraries in the appropriate section for your linker to find them.

glu32.dll and OpenGL32.dll go in windows>system32 (On NT/XP system, which I have to assume you are using).

That should basically be it. Keep in mind that the latest version of the OpenGL headers and libs provided by microsoft is only 1.1, however, if you keep your vendor specific drivers up to date from your video card's company, then you have all of the latest versions of everything regardless.

Well I suppose that i'll go with DirectX considering that there are sound, input, etc libs. So that one book, Tricks of the Windows Game Programming Gurus by Andrew Lamothe., would it be worth my while to pickup, even though I am using BCB6?

Dump BCB6 for games. Trying to get it to work with DX9 will be more of a headache than simply going out and purchasing MSVC Student Edition or equivalent.

Using DirectInput for input is very simple and very fast..hence low latency. ANY API calls made from within OpenGL or DirectX will entail an extremely high latency. Do not under any circumstances use the Windows API for input, sound, graphics, text, etc. You will incur major framerate hits as your engine grows. DirectX has everything you need and its fairly simple to use once you get the hang of it.

As far as rendering choice it is purely up to you. But nothing beats DirectInput, DirectPlay, and DirectMusic (ie: DirectSound & DirectMusic) for games. DirectMusic starting with DX9 has some insanely low latency times which allows the use of hair-trigger sound effects and they sound great and have no choppiness in them.

If you are looking for more speed in your renderer then you will have to fine tune a lot of your classes to use hand-tuned and hand-written assembly code. Nothing the compiler could produce will outperform carefully hand-crafted and fine tuned assembly code. This holds true for your vector class functions as well as a host of other functions. But you should be able to get decent performance without using assembly....however if you are serious about framerates carefully placed assembly functions will be needed. Several books I've read support this theory contrary to the belief that you can be lazy and the compiler optimizations will make up the difference. They won't in every case.

I would also recommend the Tricks of the 3D Game Programming Gurus, which is LaMothe's sequel of sorts to Tricks of the Windows Programming Gurus. It's heavy on the graphics end, but it includes the library he builds for game programming. It uses directx and you can get a good introduction to directx and how its functions are used by looking through the library, while programming with the library which is easier than directx itself.