Separate Shaders

https://github.com/kion-dgl/DashGL-GTK-Brickout-Tutorial/tree/master/03_Separate_Shaders

Same blue triangle with separate shaders

Now that we have tested that GTK and OpenGL works, we're going to move our shader files out of our source code into separate files. We're going to clone DashGL into our project folder for this.

$ git clone https://github.com/kion-dgl/DashGL-Library.git DashGL
$ mkdir shader

Now we can simplify our main.c.

Vertex Shader

Fragment Shader

Compile with:

Run with:

Last updated

Was this helpful?