craftlinks / zig_learn_opengl

Follow the Learn-OpenGL book using Zig

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windowing library: mach/glfw - Ziggified GLFW bindings by slimsag (Stephen Gutekanst).

OpenGL bindings for Zig were generated by the zig-opengl project by MasterQ32 (Felix Queißner).

zstbi - stb image bindings, zmath - SIMD math library, provided by Michal Ziulek, part of the zig-gamedev project.

Sample programs can be used together with the reference book: Learn OpenGL - Graphics Programming by Joey de Vries.


Zig Language installation How-to instructions.


I. Getting Started

Hello Triangle

  • hello_triangle: Minimal setup for drawing a trianlge on screen.
    zig build hello_triangle-run
    hello triangle
  • hello_rectangle: Draw a rectangle efficiently with indexed rendering using the 'Element Buffer Object'.
    zig build hello_rectangle-run
    hello triangle

Shaders

  • shaders: Little programs that rest on the GPU
    zig build shaders-run
    shaders

    Shader struct mirrors the C++ Shader Class in the book.

Textures

  • textures: Decorate objects with textures
    zig build textures-run
    textures

Transformations

  • Transformations: Apply a transformation matrix to vertex data
    zig build transformations-run
    transformations

Coordinate Systems

Camera

  • Camera rotation: Camera rotation around world origin
    zig build camera_rotate-run

  • Simple camera: Fly-like camera
    zig build simple_camera-run

II. Lighting

Basic Lighting

About

Follow the Learn-OpenGL book using Zig

License:Other


Languages

Language:Zig 59.3%Language:C 40.5%Language:GLSL 0.2%