Skip to content

VeroAsghar/rendering-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mach/glfw OpenGL example

This is an example for how to use mach-glfw and zig-opengl together to create a modern OpenGL 4.1 (latest version supported on macOS) window.

Getting started

Clone the repository

Cloning submodules is required, so use --recursive:

git clone --recursive https://github.com/hexops/mach-glfw-opengl-example
cd mach-glfw-opengl-example/

Run the example

zig build run

Next steps

Understanding this example

This example only clears the screen to a purple color. It doesn't show how to get e.g. triangles onto the screen; you'll need to look at other OpenGL examples for that as a next step. We're happy to accept a PR for this.

Understanding how zig-opengl works

zig-opengl provides a binding generator which uses dotnet to generate pure-Zig OpenGL bindings. We generate and commit them to this repository for simplicity:

cd libs/zig-opengl/
mkdir exports/
dotnet run -- OpenGL-Registry/xml/gl.xml ../gl.zig GL_VERSION_4_1

Getting help

You can join the Mach discord for help if this example doesn't work. Also consider joining the Zig discord's #gamedev channel.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published