Skip to content

Basic triangle

This is the most basic example of how to use the GLFW library. You can think of it as a "Hello World" example. In this example, we create a window and render a triangle.

This example does not utilize our helper class to keep it as basic as possible.

A triangle drawn with OpenGL in PHP

A triangle drawn with OpenGL in PHP

Run this example:

php examples/01_triangle.php