Chapter 2. Hello Triangle: An OpenGL ES 3.0 Example

To introduce the basic concepts of OpenGL ES 3.0, we begin with a simple example. This chapter shows what is required to create an OpenGL ES 3.0 program that draws a single triangle. The program we will write is just about the most basic example of an OpenGL ES 3.0 application that draws geometry. This chapter covers the following concepts:

• Creating an on-screen render surface with EGL

• Loading vertex and fragment shaders

• Creating a program object, attaching vertex and fragment shaders, and linking a program object

• Setting the viewport

• Clearing the color buffer

• Rendering a simple primitive

• Making the contents of the color buffer visible in the EGL window surface

As it turns out, ...

Get OpenGL ES 3.0 Programming Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.