Skip to content

tycode/zigNeHe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zigNeHe

The ancient NeHe OpenGL tutorials, ported to the Zig language.

Based largely on the C-based glfw 2 NeHe tutorials by Joseph Redmon (pjreddie@) with updates for glfw 3. Other useful base material from andrewrk/tetris.

Currently tested on Linux (Debian 12) with Zig version 0.15.2.

Older versions were tested on MacOS and FreeBSD. Some tweaking may be needed to get the latest version running, or to build on other OSes - contributions welcome.

Requirements

You will need to install glfw.

MacOS

brew install glfw

On MacOS, you will also need to install XCode in order to get the OpenGL framework.

Debian 11-12

apt install libglfw3-dev libglu1-mesa-dev

Building and running

In each LessonXX directory, you can build and run the given tutorial by running:

zig build run

On MacOS, you may run into linking problems with OpenGL. If this happens try:

ZIG_SYSTEM_LINKER_HACK=1 zig build run

Screenshot

From Lesson 6:

Screenshot

TODO

  • Should do error-handling in a more Zig-like way, and actually deal with gl initialization failing.
  • All the lessons.

About

NeHe OpenGL tutorials, ported to the Zig language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 91.9%
  • Zig 8.1%