triangle

command
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Hello Triangle: the classic first OpenGL ES 2.0 program.

Demonstrates:

  • Compiling a vertex shader and a fragment shader
  • Linking them into a program
  • Uploading triangle vertex data into a VBO
  • Setting up vertex attribute pointers
  • Drawing with DrawArrays
  • Reading back pixels to verify the triangle was rasterized

The triangle covers the center of a 64x64 pbuffer. After rendering, the program reads back the center pixel (which should be inside the triangle) and a corner pixel (which should be the clear color) to confirm correctness.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL