O'Reilly logo

OpenGL® SuperBible: Comprehensive Tutorial and Reference, Sixth Edition by Richard S Wright, Graham Sellers, Nicholas Haemel

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 2. Our First OpenGL Program

What You’ll Learn in This Chapter

• How to create and compile shader code

• How to draw with OpenGL

• How to use the book’s application framework to initialize your programs and clean up after yourself

In this chapter, we introduce the simple application framework that is used for almost all of the samples in this book. This shows you how to create the main window with the book’s application framework and how to render simple graphics into it. You’ll also see what a very simple GLSL shader looks like, how to compile it, and how to use it to render simple points. The chapter concludes with your very first OpenGL triangle.

Creating a Simple Application

To introduce the application framework that’ll be used ...

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