Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

This is the Preview Version of the Tutorial

Here, some or most of the chapter might not be finished yet.

You can find the actual tutorial with only the finished chapters at opengl.zgtm.eu.

Learn OpenGL with Rust

An OpenGL tutorial with lots of basic OpenGL and lots of unsafe Rust code. Uses glwindow, a tiny wrapper around winit and glutin.

To start reading, use your arrow keys ([←], [→]), the page turners on the left and the right of the page, the table of contents on the left, or just click on one of the images below to jump straight in! If you find the page too dark, you can change the colours to another mdBook theme by clicking on the brush in the top left corner of the page.

You can find the complete source code for everything in this tutorial on github.

If you stumble upon any problem, or if you have something else you want to tell me, feel free to open an issue or PR at github, or write me an email to opengl[ AT ]zgtm.eu.

This tutorial is still incomplete and currently being worked on. Check out preview.opengl.zgtm.eu to see what’s currently being worked on (IPv6 only).

– zgtm @ July 2025

Jump Straight In

Start by installing Rust or click on one of the following images to jump directly to the corresponding chapter:

Our first window Our first window with background

Our first triangle Our first coloured triangle