The steps involved in setting the value of a uniform variable include finding the location of the variable, and assigning a value to that location using one of the glUniform functions.
In this example, we start by clearing the color buffer, then creating a rotation matrix using GLM. Next, we query for the location of the uniform variable by calling glGetUniformLocation. This function takes the handle to the shader program object and the name of the uniform variable, and returns its location. If the uniform variable is not an active uniform variable, the function returns -1.