OpenGL

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

OpenGL is the cross-platform graphics API that taught a generation of programmers how a GPU draws. This sub-section teaches desktop OpenGL 4.6, OpenGL ES 3.2, their shading languages GLSL 4.60 and GLSL ES 3.20, and EGL 1.5, the glue that connects them to a window. It follows one running example, the Bookshelf GL program, from a single triangle to a small game, and it says plainly where OpenGL stands in 2026: frozen at version 4.6, deprecated on Apple platforms, still extended by Khronos and still the base of OpenGL ES on Android and embedded devices. The pages build on the general pages of Graphics & Games; read those first if the rendering pipeline or the transformation chain are new to you.

What OpenGL, OpenGL ES, GLSL and EGL are

Name What it is

OpenGL

A specification, maintained by the Khronos Group, of a C API that sends buffers, textures, shaders and draw commands to the GPU. Drivers implement it; there is no library to download. Version 4.6 is the last.

OpenGL ES

The subset and variant for phones, tablets and embedded devices. ES 2.0 and 3.0 dominate mobile history, and ES 3.2 is the last version. WebGL is its JavaScript binding.

GLSL and GLSL ES

The C-like shading languages in which the programmable stages are written. A shader is passed to the driver as text (or as SPIR-V since OpenGL 4.6) and compiled at run time.

EGL

The Khronos API that creates displays, surfaces and contexts for OpenGL ES (and desktop OpenGL) on Android, embedded Linux and several desktop systems.

OpenGL is a state machine with a global current context: a function call changes the state of the context that is current on the calling thread. The pages in this sub-section keep returning to that fact, because it explains the shape of the API, its convenience for learning and its cost compared with the explicit APIs described in Explicit vs Implicit Graphics APIs.

The family tree

Three timelines, desktop OpenGL from 1.0 in 1992 to 4.6 in 2017, OpenGL ES from 1.0 in 2003 to 3.2 in 2015, and WebGL 1 and 2 with the 2025 mesh shader extension
Figure 1. Releases of desktop OpenGL, OpenGL ES, WebGL and the mesh shader extension, 1992 to 2026

Desktop OpenGL grew from IRIS GL (see History of Real-Time Graphics) through a fixed-function era to the shader-based versions 2.0 and 3.x, and then through 4.0 to 4.6 added tessellation, compute shaders, direct state access and SPIR-V. OpenGL ES forked from it for mobile hardware; ES 2.0 removed the fixed function pipeline in 2007, years before the desktop did. WebGL 1 and 2 expose ES 2.0 and ES 3.0 to JavaScript. The details and the mapping between versions are on Versions, Profiles and Extensions.

Version baseline

The facts below were re-verified on 1 November 2026 against the official pages cited in the last column.

Item Version and status Source

Desktop OpenGL

4.6, core and compatibility profiles. First released on 31 July 2017; the specification was last revised on 5 May 2022. No 4.7 or 5.0 exists.

OpenGL registry, Khronos: OpenGL

GLSL

4.60, specification dated 14 August 2023. SPIR-V shaders are core since 4.6 (GL_ARB_gl_spirv).

OpenGL registry

OpenGL ES and GLSL ES

ES 3.2 (specification of 5 May 2022) with GLSL ES 3.20 (14 August 2023). ES 1.x is deprecated.

OpenGL ES registry

EGL

1.5

EGL registry

New extension activity

GL_EXT_mesh_shader was added to the registry in October 2025.

Khronos announcement

Android

OpenGL ES 2.0 from API level 8, 3.0 from 18, 3.1 from 21 and 3.2 from 24, declared with <uses-feature android:glEsVersion>. ANGLE is optional from Android 15 and a manifest request exists from Android 17. The platform recommends Vulkan for new work.

Android OpenGL ES guide, Vulkan overview

Apple

OpenGL deprecated in macOS 10.14 and OpenGL ES in iOS 12 (2018). Frozen; macOS offers up to a 4.1 core context.

Migrating OpenGL code to Metal

Translation layers

ANGLE (Direct3D 11, OpenGL, Vulkan and Metal backends, the default WebGL backend of Chrome and Firefox on Windows) and Mesa Zink (OpenGL 4.6 on Vulkan)

ANGLE, Zink

Setup libraries

GLFW 3.5.1 and the glad2 loader generator

GLFW, glad

When to choose OpenGL in 2026

Choose OpenGL when you are learning how the pipeline works, when you maintain or extend an existing OpenGL code base, when you target Android or embedded Linux devices where ES is the lowest common denominator, or when a small cross-platform tool matters more than the last 20 percent of performance. Choose Vulkan, Metal or WebGPU for a new engine, for features such as ray tracing, or for an Apple-only product. The full reasoning is in OpenGL in 2026, and the general criteria are in Choosing an API or Engine.

What’s covered

Orientation

Page Covers

OpenGL in 2026

Frozen core, live extensions, Apple, Android, ANGLE, Zink and a decision guide.

Versions, Profiles and Extensions

Core and compatibility profiles, version and extension queries, the GL, GLSL, ES and WebGL version mapping.

What Has Changed Since the Older OpenGL Guides

The corrections for the seven books, row by row.

Setup and first triangle

Page Covers

Getting Started on the Desktop

CMake, GLFW, glad2 and GLM, window hints, the render loop.

Contexts, Windows and Loaders

WGL, GLX, EGL and CGL, loaders, GLFW and SDL, headless contexts.

EGL: Displays, Configs, Surfaces and Contexts

Display, config, surface and context lifecycle on Android and embedded Linux.

Hello Triangle

The smallest complete program, in six steps.

The OpenGL Rendering Pipeline

Every stage of the pipeline, fixed and programmable.

Data and shaders

Page Covers

Buffers and Vertex Specification

Buffer objects, immutable storage, vertex formats, index buffers.

The OpenGL Shading Language (GLSL)

Types, swizzles, qualifiers, interface blocks, built-ins.

Shaders and Programs

Compile and link, separable programs, binaries, SPIR-V.

Uniforms, UBOs and SSBOs

Uniforms, std140 and std430 blocks, binding points.

Direct State Access

The 4.5 object model without bind-to-edit.

GLSL ES and Shader Portability

GLSL ES versions, precision, one shader for GL, ES and WebGL.

Transformations and camera

Page Covers

Coordinate Systems and Transforms in OpenGL

Model, view and projection with GLM, NDC, depth range, reverse-Z.

Cameras and Projection in OpenGL

Perspective and orthographic cameras, resize, orbit camera.

Appearance

Page Covers

Textures and Samplers in OpenGL

Texture objects, mipmaps, samplers, sRGB, compressed formats.

Lighting with Blinn-Phong in OpenGL

Normals, ambient, diffuse and specular, several lights.

Materials and Normal Mapping in OpenGL

Tangent space, normal and specular maps.

Physically Based Rendering Basics in OpenGL

Metallic-roughness and an image-based lighting overview.

Blending, Depth and Stencil in OpenGL

Depth test, culling, blending, transparency order, stencil outlines.

Advanced rendering

Page Covers

Framebuffers and Render to Texture

FBOs, renderbuffers, multiple render targets, post-processing.

Shadow Mapping

Depth textures, PCF, bias.

Instancing and Indirect Drawing

Instancing, multi-draw indirect, bindless extensions.

Geometry and Tessellation Shaders

The optional geometry and tessellation stages.

Compute Shaders in OpenGL

Work groups, image load and store, barriers, particles.

Mesh Shaders in OpenGL (GL_EXT_mesh_shader)

GL_EXT_mesh_shader: task and mesh stages.

Synchronisation, Queries and Transform Feedback

Fences, occlusion and timer queries, transform feedback.

Antialiasing and HDR in OpenGL

MSAA, resolve, HDR and tone mapping.

Platforms

Page Covers

OpenGL ES on Android

GLSurfaceView, threading, NDK and EGL, ANGLE.

OpenGL ES on iOS and macOS

Deprecated status, GLKit legacy, migrating to Metal.

OpenGL on Embedded Devices and Linux

EGL with GBM and KMS, Mesa, Zink, llvmpipe, Raspberry Pi.

OpenGL and WebGL

WebGL 1 and 2 against ES 2 and 3.

Engineering

Page Covers

Debugging and Tools

KHR_debug, labels, RenderDoc, apitrace, common mistakes.

OpenGL Performance

State sorting, batching, streaming, timer queries, tile-based GPUs.

Asset Loading: glTF and OBJ

OBJ, glTF 2.0, image decoding, KTX2.

Text, UI and Input

Font atlases, Dear ImGui, GLFW input, picking.

Skeletal Animation and Skinning in OpenGL

Vertex-shader skinning and glTF skins.

Porting from OpenGL to Vulkan, Metal and WebGPU

A concept map from GL to the explicit APIs.

OpenGL Cheat Sheet

The one-page A4 summary and the PDF to download.

Bar chart of pages per group: Orientation 3, Setup 5, Data and shaders 6, Transformations 2, Appearance 5, Advanced rendering 8, Platforms 4, Engineering 7
Figure 2. Pages of the sub-section by group

Coverage map

Official documentation areas

Area Official documentation Pages

GL and ES registry

The OpenGL and OpenGL ES registries, extension lists, glcorearb.h and khrplatform.h

Versions, Profiles and Extensions, Getting Started on the Desktop

Reference pages

The OpenGL 4 and OpenGL ES 3 reference pages; every code example links its page

Hello Triangle, Buffers and Vertex Specification

GLSL specifications

GLSL 4.60, GLSL ES 3.20 and GLSL 1.50

The OpenGL Shading Language (GLSL), GLSL ES and Shader Portability

EGL

EGL 1.5: display, config, surface, context, swap interval

EGL: Displays, Configs, Surfaces and Contexts, Contexts, Windows and Loaders

OpenGL Wiki

Getting Started, Rendering Pipeline Overview, Vertex Specification, buffer, VAO, shader, interface blocks, UBO, SSBO, texture, sampler, framebuffer, debug output, DSA, SPIR-V, compute, sync, common mistakes, loading functions

The OpenGL Rendering Pipeline, Buffers and Vertex Specification, Direct State Access, Debugging and Tools

Android

The OpenGL ES guide: environment, shapes, drawing, projection, motion, touch

OpenGL ES on Android

Apple

The archived OpenGL Programming Guide for Mac and Migrating OpenGL code to Metal

OpenGL ES on iOS and macOS

ANGLE and Mesa

ANGLE, Mesa, Zink and llvmpipe

OpenGL in 2026, OpenGL on Embedded Devices and Linux

Setup

GLFW documentation and the glad2 generator

Getting Started on the Desktop, Contexts, Windows and Loaders

Conformance

VK-GL-CTS and the OpenGL-Registry repository

Versions, Profiles and Extensions

Concepts from the books

The seven books and course notes are listed in the section bibliography. The short names are SB4 (OpenGL SuperBible, 4th edition), ES2PG (OpenGL ES 2.0 Programming Guide), ES3PG (OpenGL ES 3.0 Programming Guide), GLSL150 (the GLSL 1.50 specification), BRO (OpenGL ES 2 for Android), MAR (Game and Graphics Programming for iOS and Android with OpenGL ES 2.0) and APU (the Spanish notes Apuntes de OpenGL y GLUT). Each cell lists the chapters that contribute the concept, and the last column the pages that cover it. The books are consulted references: no text, figure or code is copied from them, and where a book and the official documentation disagree the documentation is followed.

Concept SB4 ES2PG ES3PG GLSL150 BRO MAR APU Pages

Pipeline overview

1 and 15

1

1

section 2

2 and 3

-

X

The OpenGL Rendering Pipeline

Context and window setup

2 and 19 to 21

3 and 15

3 and 16

-

1

1

X

Getting Started on the Desktop, Contexts, Windows and Loaders, EGL: Displays, Configs, Surfaces and Contexts

Hello triangle and primitives

3

2

2

-

2 and 3

2

X

Hello Triangle

Buffers and vertex arrays

11

6

6

-

2 and 8

3 and 5

-

Buffers and Vertex Specification

The GLSL language

15 to 17

5

5

all

3

2

-

The OpenGL Shading Language (GLSL), GLSL ES and Shader Portability

Shaders, programs and binaries

15

4

4

-

3

2

-

Shaders and Programs

Transforms, camera and viewport

4

8

8

-

5 and 6

2 and 7

X

Coordinate Systems and Transforms in OpenGL, Cameras and Projection in OpenGL

Primitive assembly and rasterisation

3

7

7

-

-

-

-

The OpenGL Rendering Pipeline

Textures, including 3D, arrays and ETC2

8 and 9

9

9

-

7 and 11

4

-

Textures and Samplers in OpenGL

Lighting and materials

5, 6, 16 and 17

8 and 10

8 and 10

-

13

10

X

Lighting with Blinn-Phong in OpenGL, Materials and Normal Mapping in OpenGL

Depth, blending, stencil and hidden surfaces

3 and 6

11

11

-

-

4

X

Blending, Depth and Stencil in OpenGL

Framebuffers, render to texture and multiple render targets

18

12

12

-

-

11

-

Framebuffers and Render to Texture

Shadows

14

13

14

-

-

10

-

Shadow Mapping

Instancing, transform feedback and synchronisation

-

-

6, 8, 13 and 14

-

-

-

-

Instancing and Indirect Drawing, Synchronisation, Queries and Transform Feedback

Particles

-

13

14

-

10

11

-

Compute Shaders in OpenGL

Picking, interaction and menus

12

-

-

-

9

6

X

Text, UI and Input

Occlusion queries

13

-

14

-

-

-

-

Synchronisation, Queries and Transform Feedback

Curves, terrain and skybox

10

-

14

-

11 and 12

-

-

Geometry and Tessellation Shaders, Textures and Samplers in OpenGL

Model loading (OBJ)

-

-

-

-

8

3

-

Asset Loading: glTF and OBJ

Skeletal animation

-

-

-

-

-

12

-

Skeletal Animation and Skinning in OpenGL

Physics, pathfinding and audio in a GL game

-

-

-

-

-

6, 8 and 9

-

Physics, Audio and Input Basics

Optimisation

11

13

14

-

-

5

-

OpenGL Performance

Android specifics

-

15

16

-

1 and 14

1

-

OpenGL ES on Android

State queries and errors

-

14

15

-

-

-

-

Debugging and Tools

Official concepts missing from the books

Several features that every current program uses were introduced after all seven books were written. They are covered from the official documentation.

Concept Pages

Direct State Access (4.5)

Direct State Access

SPIR-V shaders (4.6)

Shaders and Programs

KHR_debug (4.3)

Debugging and Tools

Immutable and persistently mapped buffers (4.4)

Buffers and Vertex Specification, Synchronisation, Queries and Transform Feedback

Multi-draw indirect

Instancing and Indirect Drawing

Compute shaders (4.3 and ES 3.1)

Compute Shaders in OpenGL

glClipControl and reverse-Z

Coordinate Systems and Transforms in OpenGL, Blending, Depth and Stencil in OpenGL

ASTC, KTX2 and Basis

Textures and Samplers in OpenGL, Asset Loading: glTF and OBJ

glTF 2.0

Asset Loading: glTF and OBJ, Physically Based Rendering Basics in OpenGL

GL_EXT_mesh_shader (2025)

Mesh Shaders in OpenGL (GL_EXT_mesh_shader)

ANGLE and Zink layering

OpenGL in 2026, OpenGL on Embedded Devices and Linux

The Android ANGLE roadmap

OpenGL ES on Android

RenderDoc

Debugging and Tools

glad2

Getting Started on the Desktop, Contexts, Windows and Loaders

Porting to Vulkan and WebGPU

Porting from OpenGL to Vulkan, Metal and WebGPU

Where the books are out of date, the page that covers the concept says so, and What Has Changed Since the Older OpenGL Guides collects the corrections.

Reading path

flowchart TD A[OpenGL in 2026, versions and profiles] --> B[Getting started, contexts, EGL] B --> C[Hello triangle, rendering pipeline] C --> D[Buffers, GLSL, shaders, uniforms, DSA] D --> E[Transforms and cameras] E --> F[Textures, lighting, materials, PBR, blending] F --> G[Framebuffers, shadows, instancing, compute, post-processing] G --> H[Android, Apple, embedded, WebGL] H --> I[Debugging, performance, assets, input, animation] I --> J[Porting to Vulkan, Metal and WebGPU] K[What changed since older guides] -.-> A L[Cheat sheet] -.-> J
  1. Read OpenGL in 2026 and Versions, Profiles and Extensions to know which API you are learning and on which platforms it runs.

  2. Set up with Getting Started on the Desktop, then draw the Hello Triangle and read The OpenGL Rendering Pipeline.

  3. Learn data and shaders: Buffers and Vertex Specification, The OpenGL Shading Language (GLSL) and Uniforms, UBOs and SSBOs.

  4. Add the camera with Coordinate Systems and Transforms in OpenGL.

  5. Give surfaces an appearance with Textures and Samplers in OpenGL, Lighting with Blinn-Phong in OpenGL and Blending, Depth and Stencil in OpenGL.

  6. Continue with the advanced pages on framebuffers, shadows, instancing, compute and post-processing, then the platform pages for the devices you target.

  7. Finish with debugging, performance and the porting map, and keep the OpenGL Cheat Sheet at hand.

Bookshelf GL, the running example

Bookshelf GL is a C++20 program built with CMake, GLFW, glad2 and GLM. Its baseline is an OpenGL 4.1 core context, so that it runs on macOS, with optional 4.6 paths (direct state access, SPIR-V, compute and mesh shaders). An Android variant in Kotlin with GLSurfaceView uses an OpenGL ES 3.0 context and shares the ES-compatible GLSL. It loads the shared bookshelf.glb and the textures described on the section landing page, and it grows page by page:

  1. a triangle (Hello Triangle)

  2. a coloured quad that becomes a book spine (Buffers and Vertex Specification)

  3. a textured, rotating book box (Textures and Samplers in OpenGL)

  4. the shelf mesh lit by a Blinn-Phong desk lamp (Lighting with Blinn-Phong in OpenGL)

  5. normal-mapped wood and a shadow map (Materials and Normal Mapping in OpenGL, Shadow Mapping)

  6. an instanced shelf of books (Instancing and Indirect Drawing)

  7. picking a book with an ID buffer (Text, UI and Input)

  8. post-processing with bloom and a vignette (Framebuffers and Render to Texture)

  9. compute-shader dust particles (Compute Shaders in OpenGL)

  10. a tiny game, "catch the falling book", with an orbit camera, input, a score and timer queries (OpenGL Performance)

Ten numbered panels from a triangle through textures, lighting, shadows, instancing, picking, bloom and compute particles to the catch the falling book game
Figure 3. Bookshelf GL grows page by page

Bibliography

Books

The OpenGL pages draw on seven books and course notes. The books are consulted references for concept coverage: no text, figure or code is copied from them, and where a book and the official documentation disagree the documentation is followed. The complete entries, with every other source of the section, are in the section bibliography.

  • Richard S. Wright Jr., Benjamin Lipchak and Nicholas Haemel, OpenGL SuperBible: Comprehensive Tutorial and Reference, 4th edition, Addison-Wesley, 2007, ISBN 978-0-321-49882-3: InformIT.

  • Aaftab Munshi, Dan Ginsburg and Dave Shreiner, OpenGL ES 2.0 Programming Guide, Addison-Wesley, 2008, ISBN 978-0-321-50279-7: InformIT.

  • Dan Ginsburg, Budirijanto Purnomo, Dave Shreiner and Aaftab Munshi, OpenGL ES 3.0 Programming Guide, 2nd edition, Addison-Wesley, 2014, ISBN 978-0-321-93388-1: InformIT.

  • John Kessenich (ed.), The OpenGL Shading Language, Version 1.50, Khronos Group, 2009: specification.

  • Kevin Brothaler, OpenGL ES 2 for Android: A Quick-Start Guide, Pragmatic Bookshelf, 2013, ISBN 978-1-937785-34-5: publisher page.

  • Romain Marucchi-Foino, Game and Graphics Programming for iOS and Android with OpenGL ES 2.0, Wrox / Wiley, 2012, ISBN 978-1-119-97591-5: Wiley.

  • Cristina Cañero Morales, Apuntes de OpenGL y GLUT, unpublished course notes in Spanish, year not stated; cited without a link.