Paddle Uniform Color

https://github.com/kion-dgl/DashGL-GTK-Brickout-Tutorial/tree/master/12_Paddle_Uniform_Color

Using a different color for different objects

We want to be able to change the color of the different components inside the window. In this case, since we're using a different color for each element, we can define color as a uniform and define when we want to switch the color.

#version 120

uniform vec3 color;

void main(void) {
	
	gl_FragColor = vec4(color, 1.0);

}

Below are the changed to the main.c for implementing color.

Compile with:

Run with:

Last updated

Was this helpful?