|
| ShaderObject (ShaderType shaderType, std::shared_ptr< const ShaderResource > resource) |
|
| ShaderObject (std::shared_ptr< const ShaderResource > resource) |
|
| ShaderObject (ShaderType shaderType, std::string_view fileName) |
|
| ShaderObject (std::string_view fileName) |
|
| ShaderObject (GLenum shaderType, std::string_view fileName) |
|
| ShaderObject (const ShaderObject &rhs)=delete |
|
| ShaderObject (ShaderObject &&rhs) noexcept |
|
ShaderObject & | operator= (const ShaderObject &that)=delete |
|
ShaderObject & | operator= (ShaderObject &&that) noexcept |
|
GLuint | getID () const |
|
std::string | getFileName () const |
|
void | setResource (std::shared_ptr< const ShaderResource >) |
|
std::shared_ptr< const ShaderResource > | getResource () const |
|
const std::vector< std::shared_ptr< const ShaderResource > > & | getResources () const |
|
ShaderType | getShaderType () const |
|
void | create () |
|
void | preprocess () |
|
void | upload () |
|
void | compile () |
|
void | build () |
|
bool | isReady () const |
|
void | addShaderDefine (std::string_view name, std::string_view value="") |
|
void | removeShaderDefine (std::string_view name) |
|
const ShaderDefines & | getShaderDefines () const |
|
void | setShaderDefine (std::string_view name, bool shouldAdd, std::string_view value="") |
|
void | setShaderDefines (ShaderDefines shaderDefines) |
|
bool | hasShaderDefine (std::string_view name) const |
|
void | clearShaderDefines () |
|
void | addShaderExtension (std::string_view extName, bool enabled) |
|
void | addShaderExtension (std::string_view extName, ExtensionBehavior behavior) |
|
void | setShaderExtension (std::string_view extName, ExtensionBehavior behavior, bool shouldAdd) |
|
void | removeShaderExtension (std::string_view extName) |
|
bool | hasShaderExtension (std::string_view extName) const |
|
void | clearShaderExtensions () |
|
void | addSegment (ShaderSegment segment) |
|
void | removeSegments (std::string_view segementName) |
|
void | clearSegments () |
|
void | addOutDeclaration (std::string_view name, int location=-1, std::string_view type="vec4") |
| adds an additional output specifier to the shader The given name will be added as
|
|
void | addOutDeclaration (const OutDeclaration &decl) |
|
void | clearOutDeclarations () |
|
const std::vector< OutDeclaration > & | getOutDeclarations () const |
|
void | addInDeclaration (std::string_view name, int location=-1, std::string_view type="vec4") |
| adds an additional input specifier to the shader The given name will be added as
|
|
void | addInDeclaration (const InDeclaration &decl) |
|
void | clearInDeclarations () |
|
const std::vector< InDeclaration > & | getInDeclarations () const |
|
void | addStandardFragmentOutDeclarations () |
|
void | addStandardVertexInDeclarations () |
|
std::pair< std::string, size_t > | resolveLine (size_t line) const |
|
std::string | print (bool showSource=false, bool preprocess=true) |
|
template<typename T> |
std::shared_ptr< Callback > | onChange (T &&callback) |
|
A wrapper for an OpenGL shader object. Handles loading sources from shader resources, either files or stings. Pre-processes the sources resolving all include with help of the shader manager. Keeps a lookup table of from which include each line originates. Handles a list of defines, that can be added or removed
- See also
- addShaderDefine Handles a list of shader extensions
-
addShaderExtension Handles a list of input declarations
-
addInDeclaration Handles a list of output declarations
-
addOutDeclaration
A fragment shader will by default have the following out declarations: out vec4 FragData0; (location 0) out vec4 PickingData; (location 1) and a vertex shader will by default have the following in declarations: in vec4 in_Vertex; (location 0) in vec3 in_Normal; (location 1) in vec4 in_Color; (location 2) in vec3 in_TexCoord; (location 3) The defaults can be removed by calling clearOutDeclarations or clearInDeclarations respectively.