Book Image

OpenGL Game Development By Example

By : Stephen Madsen, Robert Madsen
Book Image

OpenGL Game Development By Example

By: Stephen Madsen, Robert Madsen

Overview of this book

OpenGL is one of the most popular rendering SDKs used to develop games. OpenGL has been used to create everything from 3D masterpieces running on desktop computers to 2D puzzles running on mobile devices. You will learn to apply both 2D and 3D technologies to bring your game idea to life. There is a lot more to making a game than just drawing pictures and that is where this book is unique! It provides a complete tutorial on designing and coding games from the setup of the development environment to final credits screen, through the creation of a 2D and 3D game. The book starts off by showing you how to set up a development environment using Visual Studio, and create a code framework for your game. It then walks you through creation of two games–a 2D platform game called Roboracer 2D and a 3D first-person space shooter game–using OpenGL to render both 2D and 3D graphics using a 2D coordinate system. You'll create sprite classes, render sprites and animation, and navigate and control the characters. You will also learn how to implement input, use audio, and code basic collision and physics systems. From setting up the development environment to creating the final credits screen, the book will take you through the complete journey of creating a game engine that you can extend to create your own games.
Table of Contents (19 chapters)
OpenGL Game Development By Example
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Revving up your engine


Now that you have a better understanding of how audio works in your computer, it's time to write some code to bring audio into your game. We generally don't work with audio directly. Instead, there are audio engines that do all of the hard work for us, and one of the most popular ones is FMOD.

FMOD is a C and C++ API that allows us to load, manage, and play audio sources. FMOD is free to use for student and independent projects, so it is the perfect audio engine for our game. To use FMOD, you will have to go to the FMOD website, download the appropriate version of the API, and install it on your system:

  1. To download FMOD, go to http://www.FMOD.org/download/.

  2. There several downloads to choose from. Scroll down to the FMOD Ex Programmer's API, and click the Download button for Windows.

  3. You will have to locate the exe file that you just downloaded and install it. Make a note of the folder that FMOD is installed in.

  4. Once you have downloaded FMOD, you will have to incorporate...