Game Programming Books
I'm wanting to learn some 2d/3d DirectX/OpenGl Graphics, and am looking for a good book. I'm using Borland C++ Builder 6, and had this
reccomended to me.
The fello who reccomended it said that it was more taylored towards VC++, but is easy to addapt to BCB6. Could any reccommend any other BCB6 books, or give me their thoughts on the other one?
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.
Still not sure what to buy? Check out stuff here:
What would you reccommend I start to learn? OpenGl or DirectX? This is what I would *like* to be able to do...
Start with simple 2d games, then build up to more fancy stuff like pixel shadder thingys, shadows, and eventualy make and 3D FPS game.
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.
Which, in the long run, is most powerfull and/or most utilitarian?
Neither is more powerful than the other. Any speed differences are so minute it's not worth fighting over, and it's not at fault of the API, but rather the drivers.
OpenGL is a graphics libary, and nothing but. DirectX has a graphics, sound, and input library as well as a few other libraries for media files. However, each is different in it's own respect.
From a shear graphics standpoint, any argument as to which one is better in any regards is pretty much moot.
to start programming in DirectX you need the DX SDK but what do you need to start programming with OpenGL?
Okay, you need to download the latest OpenGL headers and libraries from microsoft. This direct link is here:
The webpage it is on is here (the link is down the page a bit):
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.
It is sort of confusing, and their website makes things hard to find.
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?
well, we aren't really talking about input, because OpenGL is just a rendering API. You would have to use DirectX, or some other form of input/sound, even if you did use OpenGL for rendering.
I personally prefer to use OpenGL for rendering, FMOD for sound, and the non-buffered Windows API functions for input.
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.
Go over here to get some good idea on books to read:
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.