As we created our shader files and the Shader.h header file in the preceding sections, we'll now load those files into our triangle code. To do this, we'll have to make certain changes to the triangle code that we wrote earlier. Check out the below mentioned steps:
- We'll begin by including the Shader.h header file, because without that we can't actually use the Shader class:
#include "Shader.h"
- Then, before defining our vertices, we'll add the following line of highlighted code:
// Build and compile our shader program Shader ourShader( "core.vs", "core.frag" );