OpenGL game development by example design and code your own 2D and 3D games efficiently using OpenGL and C++

What You Will Learn Set up your development environment in Visual Studio using OpenGL Use 2D and 3D coordinate systems Implement an input system to handle the mouse and the keyboard Create a state machine to handle complex changes in the game Load, display, and manipulate both 2D and 3D graphics Imp...

Full description

Bibliographic Details
Main Authors: Madsen, Robert, Madsen, Stephen (Author)
Format: eBook
Language:English
Published: Birmingham Packt Publishing 2016
Series:Community experience distilled
Subjects:
Online Access:
Collection: O'Reilly - Collection details see MPG.ReNa
Table of Contents:
  • Linking to the OpenGL librarySummary; Chapter 2: Your Point of View; Plotting your revenge; The OpenGL coordinate system; Making your point; Understanding the code; Running the program; Stretching your point; Getting primitive; A triangle by any other name; A primitive example; From triangles to models; Introducing textures; Using textures to fill the triangles; A matter of reference; Hanging out in the quad; Coding the quad; Rendering a texture; Loading the texture; Texture wrapping; Creating a textured quad; Putting the pieces together; Summary; Chapter 3: A Matter of Character
  • Cover; Copyright; Credits; About the Authors; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Building the Foundation; Introducing the development environment; A quick look at Visual Studio; Start screen; The Solution Explorer panel; The Standard Toolbar panel; The code window; The output window; Starting your project; The game loop; The game structure; Initialization; The game loop; Shutdown; Creating the game structure; Port of access; The Windows message loop; Introducing OpenGL; What is OpenGL?; The other GL; Downloading OpenGL; Adding OpenGL to the project
  • Implementing the main Update callImplementing Update in the Sprite class; Character movement; Using delta time; Calculating delta time; Flipping; Scrolling the background; Using an atlas; Summary; Chapter 4: Control Freak; A penny for your input; The keyboard input; Using the mouse; Touch; Other inputs; Someone is listening; The WndProc event listener; Handling the message queue; Handling mouse and keyboard inputs; Creating the Input class; Virtual key codes; Querying for input; Implementing the Input class; Adding input to the game loop; Processing our input; Changes to the Sprite class
  • Spritely speakingSprites versus non-sprites; Flipbook animation; Framed animation; Creating sprites; Working with PNGs; Linking to the SOIL library; Including the SOIL header file; Opening an image file; Coding a sprite class; Creating sprite frames; Saving each frame; Loading a sprite from individual textures; Creating a sprite sheet; Loading a sprite sheet; Loading our sprites; Rendering; Adding a render to the game loop; Implementing the main Render function; Implementing Render in the Sprite class; UV mapping; One more detail; A moving example; Adding update to the game loop
  • Graphical User InterfaceCreating a button; Enhancing the Input class; Adding UI elements to the list; Checking each UI element; Pushing your buttons; Adding our pauseButton; State management; Creating a state manager; Pausing the game; Summary; Chapter 5: Hit and Run; Out of bounds!; Getting anchored; Collision rectangles; Embedding; Fixing the background; Collideables; Ready to score; A friend indeed; Time to spawn; Circular collision detection; The Pythagorean Theorem; Adding the circular collision code; Why use circular collision detection?; Wiring in the collision detection