URL: https://graphicscomputing.fr/cgp/reference/opengl_shader_structure/
Description: OpenGL shader program.

# opengl_shader_structure

OpenGL shader program.

Fields:

- `GLuint id` - OpenGL id of the shader program, 0 when no shader is loaded.

Functions taking it:

- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, int value, bool expected = true)` - Send an int uniform to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, GLuint value, bool expected = true)` - Send an unsigned value as an int uniform (e.g. a texture unit) to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, float value, bool expected = true)` - Send a float uniform to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, vec2 const& value, bool expected = true)` - Send a vec2 uniform to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, vec3 const& value, bool expected = true)` - Send a vec3 uniform to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, vec4 const& value, bool expected = true)` - Send a vec4 uniform to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, float x, float y, bool expected = true)` - Send a vec2 uniform given by its two components to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, float x, float y, float z, bool expected = true)` - Send a vec3 uniform given by its three components to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, float x, float y, float z, float w, bool expected = true)` - Send a vec4 uniform given by its four components to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, mat4 const& m, bool expected = true)` - Send a mat4 uniform (row-major, transposed on upload) to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, mat3 const& m, bool expected = true)` - Send a mat3 uniform (row-major, transposed on upload) to the shader; warns if the uniform is not found and expected is true.
- `void opengl_uniform(opengl_shader_structure const& shader, std::string const& name, mat2 const& m, bool expected = true)` - Send a mat2 uniform (row-major, transposed on upload) to the shader; warns if the uniform is not found and expected is true.
