Skip to content

cjbarre/opengl-with-jank

Repository files navigation

OpenGL with Jank

This repo has no end-goal purpose other than for it to be a vehicle that I use to learn OpenGL and Jank. I'm not a C/C++ language or toolchain expert, so I can't predict ahead of time what sorts of issues you may run into trying to run the code in this repo.

The current setup is heavily skewed toward macos, since that's what I'm running.

You certainly need OpenGL and GLFW to get anywhere close to running the code.

Even if you can't run the code, hopefully you can still learn how Jank interops with C and C++ in order to make use of the OpenGL API.

You may notice that the high level functionality around shaders, textures, io, geometry are structured as components with an interface.jank and core.jank file. This is because I'm simulating a Polylith architecture.

Cloning

This repo has submodules.

git clone --recursive ...

Points of Interest

clet macro.

One of the first things I noticed working with C in Jank is that you end up with a lot of nested conditionals doing error checking, so I decided to experiment with a macro called clet which enables more linear C programming, error checking, and error handling.

This interop guide was generated by AI and may be inaccurate in certain areas, but overall, I found it to be very useful for either finding a valid interop pattern or leading to a good enough question to ask in the Jank slack channel.

Running the code

Presuming you have all the required tweaks and setup for your platform:

./run {}

Conclusion

I hope this is useful in some way!

About

Aspects of learning OpenGL with the Jank programming language

Topics

Resources

Stars

Watchers

Forks