The ShaderProgram class in C++ is a part of modern graphics programming that allows the creation and management of shader programs. A shader program is a set of shaders that work together to create an output in a graphics pipeline. It could be used to create real-time graphics, video games, or other applications where visual effects are required.
//create shader program object ShaderProgram myShaderProgram;
//compile fragment shader myShaderProgram.compileShaderFromFile("fragmentShader.glsl", ShaderType::FRAGMENT);
//link the shaders together to create a shader program myShaderProgram.link();
//use the shader program myShaderProgram.use();
This code creates a ShaderProgram object, compiles a vertex shader and a fragment shader, links them to create a shader program, and finally, it uses the shader program.
The ShaderProgram class is a part of the OpenGL library.
C++ (Cpp) ShaderProgram - 30 examples found. These are the top rated real world C++ (Cpp) examples of ShaderProgram extracted from open source projects. You can rate examples to help us improve the quality of examples.