-
Notifications
You must be signed in to change notification settings - Fork 9
Shader Class
Sets the program to 0.
Deletes the list of shaders that were created. Deletes the program that was built.
Creates a program to attach the shaders to.
Sets the program as the rendering state in the OpenGL pipeline.
The shaders here are written into the code and will be set to the string depending on the type selected to load. A shader object is creates and added to the list. The shader code is added to the shader object and compiled. Check for errors compiling and then add it to the program.
Finally the program must be linked and validated. Then the shader list is no longer needed so it can be deleted.
This function is used to find the location of variables in the program and return the location to the caller. Used to find items such as model, view, and projection matrix.
The program that all is linked to and loaded for use in the rendering.
A list of the shaders to keep them together.
Adding shaders can be adjusted later on when needed to read a shader from a file. Multiple shader classes can be used in one Project to render objects differently. Think Per-Vertex and Per-Fragment lighting and there is no need to write multiple programs to see the difference just have different shaders. The getting of a uniform location does not need to be constrained to the model, view, and projection. An example would be sending in a time float value and have time influence vertex rendering locations. Look up "How to render a flag in OpenGL".

.png)