Skip to content

Latest commit

 

History

History

examples

Examples

1. Hello World

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.

Code: 01_triangle.php!

s

2. 3D Cube

This example shows how to render a 3D cube using PHP OpenGL.

Code: 02_3D_cube.php!

s.mov

3. Textured Cube

This example shows how to render a textured cube using PHP OpenGL. It provides an example of how to load a texture from a file and how to use it in a shader using the PHP-GLFW GL\Texture\Texture2D class.

Code: 03_textured_cube.php!

s.mov

4. Instanced Rendering

This example shows how to render multiple instances of a single object using PHP OpenGL. It is just a basic example of how to use instanced rendering.

Code: 04_instancing.php!

s.mov

5. Object file loading

This example shows how to load a 3D object from a file using PHP OpenGL. It displays how to utilize the \GL\Geometry\ObjFileParser class to load a 3D object from a file and how to render it.

Code: 05_objloading.php!

s

6. Simple lighting

This example shows how to render a 3D object with simple lighting using PHP OpenGL.

Code: 06_basic_light.php!

s

7. Text Rendering

This example shows how to render text using PHP OpenGL. It uses a simple bitmap font to render text on the screen.

Code: 07_text_rendering.php!

s

8. Input And Events

This example shows how to handle input and events using PHP OpenGL. It implements all available input and window event callbacks and prints them to the console.

Code: 08_input_and_events.php!