UniShader
1.0.0a
Interface for GPGPU and working with shader programs
|
Shader object class. More...
#include <ShaderObject.h>
Classes | |
class | CompilationStatus |
Shader object compilation status. More... | |
class | SignalID |
Signal identifier enum. More... | |
class | Type |
Shader object type. More... | |
Public Types | |
typedef std::shared_ptr < ShaderObject > | Ptr |
Shared pointer. | |
typedef std::shared_ptr< const ShaderObject > | PtrConst |
Shared pointer. | |
Public Member Functions | |
virtual const std::string & | getClassName () const |
Get name of this class. | |
bool | loadFile (const std::string fileName, Type shaderType=Type::NONE) |
Load source code for shader object from file. | |
bool | loadCode (const std::string code, Type shaderType) |
Load source code for shader object from string. | |
bool | ensureCompilation () |
Ensure compilation. | |
unsigned int | getGlID () const |
Get OpenGL shader object identifier. | |
Type | getType () const |
Get shader object type. | |
CompilationStatus | getCompilationStatus () const |
Get shader object compilation status. | |
Static Public Member Functions | |
static Ptr | create () |
Create shader object. |
Shader object class.
Shader objects are elementary parts of shader program. They are similar to C++ object files as they are each compiled separately and then can be mixed to create complex programs. There are vertex, geometry and fragment shader objects, each affecting corresponding stage in shader pipeline. By default, files with extension
.vert are recognized as vertex, *.geom as geometry and .frag as fragment objects.
static Ptr ShaderObject::create | ( | ) | [static] |
Create shader object.
Get shader object compilation status.
unsigned int ShaderObject::getGlID | ( | ) | const |
Get OpenGL shader object identifier.
Type ShaderObject::getType | ( | ) | const |
Get shader object type.
bool ShaderObject::loadCode | ( | const std::string | code, |
Type | shaderType | ||
) |
Load source code for shader object from string.
code | Source code. |
shaderType | Type of shader object. |
bool ShaderObject::loadFile | ( | const std::string | fileName, |
Type | shaderType = Type::NONE |
||
) |
Load source code for shader object from file.
fileName | Name of file with source code. |
shaderType | Type of shader object. |