O'Reilly logo

Game Programming in C++: Creating 3D Games, First Edition by Sanjay Madhav

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5

Opengl

This chapter provides an in-depth introduction on how to use OpenGL for graphics in games. It covers many topics, including initializing OpenGL, using triangles, writing shader programs, using matrices for transforms, and adding support for textures. The game project for this chapter converts the game project from Chapter 3, “Vectors and Basic Physics,” to use OpenGL for all its graphics rendering.

Initializing OpenGL

Although the SDL renderer supports 2D graphics, it does not support 3D. Thus, to switch to 3D, which is used in every subsequent chapter in this book, you need to switch from SDL 2D graphics to a different library that supports both 2D and 3D graphics.

This book uses the OpenGL library. OpenGL is an industry-standard ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required