Base class that defines the interface for graphics programs.
More...
#include <SurgSim/Graphics/Program.h>
Base class that defines the interface for graphics programs.
A program in OSS is a collection of 'shaders' that are usually executed in sequence (Geometry, Vertex and Fragment). Each shader itself is software that is executed on the GPU, shaders are usually introduced as source. The concept is similar to the use of program in OpenGL see https://www.opengl.org/sdk/docs/man4/html/glCreateProgram.xhtml
§ ~Program()
SurgSim::Graphics::Program::~Program |
( |
| ) |
|
|
inlinepure virtual |
§ clear()
virtual void SurgSim::Graphics::Program::clear |
( |
| ) |
|
|
inlinevirtual |
Clears the entire shader, returning to fixed-function pipeline.
§ clearFragmentShader()
virtual void SurgSim::Graphics::Program::clearFragmentShader |
( |
| ) |
|
|
pure virtual |
§ clearGeometryShader()
virtual void SurgSim::Graphics::Program::clearGeometryShader |
( |
| ) |
|
|
pure virtual |
§ clearVertexShader()
virtual void SurgSim::Graphics::Program::clearVertexShader |
( |
| ) |
|
|
pure virtual |
§ getFragmentShaderSource()
virtual bool SurgSim::Graphics::Program::getFragmentShaderSource |
( |
std::string * |
source | ) |
const |
|
pure virtual |
§ getGeometryShaderSource()
virtual bool SurgSim::Graphics::Program::getGeometryShaderSource |
( |
std::string * |
source | ) |
const |
|
pure virtual |
§ getVertexShaderSource()
virtual bool SurgSim::Graphics::Program::getVertexShaderSource |
( |
std::string * |
source | ) |
const |
|
pure virtual |
§ hasFragmentShader()
virtual bool SurgSim::Graphics::Program::hasFragmentShader |
( |
| ) |
const |
|
pure virtual |
§ hasGeometryShader()
virtual bool SurgSim::Graphics::Program::hasGeometryShader |
( |
| ) |
const |
|
pure virtual |
§ hasVertexShader()
virtual bool SurgSim::Graphics::Program::hasVertexShader |
( |
| ) |
const |
|
pure virtual |
§ isGlobalScope()
virtual bool SurgSim::Graphics::Program::isGlobalScope |
( |
| ) |
const |
|
pure virtual |
§ loadFragmentShader()
virtual bool SurgSim::Graphics::Program::loadFragmentShader |
( |
const std::string & |
filePath | ) |
|
|
pure virtual |
Loads the fragment shader source code from a file.
- Parameters
-
filePath | Path to file containing shader source code |
- Returns
- True if the source is successfully loaded, otherwise false.
Implemented in SurgSim::Graphics::OsgProgram.
§ loadGeometryShader()
virtual bool SurgSim::Graphics::Program::loadGeometryShader |
( |
const std::string & |
filePath | ) |
|
|
pure virtual |
Loads the geometry shader source code from a file.
- Parameters
-
filePath | Path to file containing shader source code |
- Returns
- True if the source is successfully loaded, otherwise false.
Implemented in SurgSim::Graphics::OsgProgram.
§ loadVertexShader()
virtual bool SurgSim::Graphics::Program::loadVertexShader |
( |
const std::string & |
filePath | ) |
|
|
pure virtual |
Loads the vertex shader source code from a file.
- Parameters
-
filePath | Path to file containing shader source code |
- Returns
- True if the source is successfully loaded, otherwise false.
Implemented in SurgSim::Graphics::OsgProgram.
§ setFragmentShaderSource()
virtual void SurgSim::Graphics::Program::setFragmentShaderSource |
( |
const std::string & |
source | ) |
|
|
pure virtual |
§ setGeometryShaderSource()
virtual void SurgSim::Graphics::Program::setGeometryShaderSource |
( |
const std::string & |
source | ) |
|
|
pure virtual |
§ setGlobalScope()
virtual void SurgSim::Graphics::Program::setGlobalScope |
( |
bool |
val | ) |
|
|
pure virtual |
When this is set to true, this shader should be used instead of other shaders that might apply, depending on the hierarchy that is set out.
E.g if this shader is on a camera, the shaders that occur in a group attached to that camera will be overridden. This will usually be used in conjunction with
- See also
- RenderPass.
- Parameters
-
val | If true the shader should override shaders in lower levels. |
Implemented in SurgSim::Graphics::OsgProgram.
§ setVertexShaderSource()
virtual void SurgSim::Graphics::Program::setVertexShaderSource |
( |
const std::string & |
source | ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: