Shader Object.
More...
#include <shader_object.h>
List of all members.
Public Member Functions |
|
|
unsigned int | get_handle () const |
| Returns the OpenGL shader handle.
|
CL_ShaderType | get_shader_type () const |
| Gets the shader type.
|
CL_String | get_info_log () const |
| Get shader object's info log.
|
CL_String | get_shader_source () const |
| Get shader source code.
|
bool | is_null () const |
| Returns true if this object is invalid.
|
void | throw_if_null () const |
| Throw an exception if this object is invalid.
|
CL_ShaderObjectProvider * | get_provider () const |
| Get Provider.
|
|
|
bool | operator== (const CL_ShaderObject &other) const |
| Handle comparison operator.
|
bool | compile () |
| Compile program.
|
Construction |
|
| CL_ShaderObject () |
| Constructs a null instance.
|
| CL_ShaderObject (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &source) |
| Constructs an OpenGL shader.
|
| CL_ShaderObject (CL_GraphicContext &gc, CL_ShaderType type, const std::vector< CL_StringRef > &sources) |
| Constructs a ShaderObject.
|
| CL_ShaderObject (CL_GraphicContextProvider *gc_provider, CL_ShaderType type, const CL_StringRef &source) |
| Constructs a ShaderObject.
|
| CL_ShaderObject (CL_GraphicContextProvider *gc_provider, CL_ShaderType type, const std::vector< CL_StringRef > &sources) |
| Constructs a ShaderObject.
|
virtual | ~CL_ShaderObject () |
static CL_ShaderObject | load (CL_GraphicContext &gc, const CL_StringRef &resource_id, CL_ResourceManager *resources) |
| Load.
|
static CL_ShaderObject | load (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &filename, const CL_VirtualDirectory &directory) |
| Load.
|
static CL_ShaderObject | load (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &fullname) |
| Load.
|
static CL_ShaderObject | load (CL_GraphicContext &gc, CL_ShaderType type, CL_IODevice &file) |
| Load.
|
static CL_ShaderObject | load_and_compile (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &filename, const CL_VirtualDirectory &directory) |
| Load and compile.
|
static CL_ShaderObject | load_and_compile (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &filename) |
| Load and compile.
|
static CL_ShaderObject | load_and_compile (CL_GraphicContext &gc, CL_ShaderType type, CL_IODevice &file) |
| Load and compile.
|
Detailed Description
Shader Object.
The source code that makes up a program that gets executed by one of the programmable stages is encapsulated in one or more shader objects. Shader objects are attached to a program objects to form a programmable setup. CL_ShaderObject is ClanLib's C++ interface to OpenGL shader objects.
Constructor & Destructor Documentation
CL_ShaderObject::CL_ShaderObject |
( |
|
) |
|
Constructs a null instance.
Constructs an OpenGL shader.
- Parameters:
-
| type | Shader type. Can be cl_shadertype_vertex or cl_shadertype_fragment. |
| source | Shader source code, in OpenGL Shader Language (GLSL). |
| gc | Graphics context in which to create the shader object |
Constructs a ShaderObject.
- Parameters:
-
| gc | = Graphic Context |
| type | = Shader Type |
| sources | = sources |
Constructs a ShaderObject.
- Parameters:
-
| gc_provider | = Graphic Context Provider |
| type | = Shader Type |
| source | = String Ref |
Constructs a ShaderObject.
- Parameters:
-
| gc_provider | = Graphic Context Provider |
| type | = Shader Type |
| sources | = sources |
virtual CL_ShaderObject::~CL_ShaderObject |
( |
|
) |
[virtual] |
Member Function Documentation
bool CL_ShaderObject::compile |
( |
|
) |
|
Compile program.
If the compiling fails, get_info_log() will return the compile log.
unsigned int CL_ShaderObject::get_handle |
( |
|
) |
const |
Returns the OpenGL shader handle.
CL_String CL_ShaderObject::get_info_log |
( |
|
) |
const |
Get shader object's info log.
Get Provider.
- Returns:
- provider
CL_String CL_ShaderObject::get_shader_source |
( |
|
) |
const |
bool CL_ShaderObject::is_null |
( |
|
) |
const [inline] |
Returns true if this object is invalid.
Load.
- Parameters:
-
| gc | = Graphic Context |
| type | = Shader Type |
| file | = IODevice |
- Returns:
- Shader Object
Load.
- Parameters:
-
| gc | = Graphic Context |
| resource_id | = String Ref |
| resources | = Resource Manager |
- Returns:
- Shader Object
Load.
- Parameters:
-
| gc | = Graphic Context |
| type | = Shader Type |
| filename | = String Ref |
| directory | = Virtual Directory |
- Returns:
- Shader Object
Load.
- Parameters:
-
| gc | = Graphic Context |
| type | = Shader Type |
| fullname | = String Ref |
- Returns:
- Shader Object
Load and compile.
- Parameters:
-
| gc | = Graphic Context |
| type | = Shader Type |
| filename | = String Ref |
- Returns:
- Shader Object
Load and compile.
- Parameters:
-
| gc | = Graphic Context |
| type | = Shader Type |
| filename | = String Ref |
| directory | = Virtual Directory |
- Returns:
- Shader Object
Load and compile.
- Parameters:
-
| gc | = Graphic Context |
| type | = Shader Type |
| file | = IODevice |
- Returns:
- Shader Object
Handle comparison operator.
void CL_ShaderObject::throw_if_null |
( |
|
) |
const |
Throw an exception if this object is invalid.
The documentation for this class was generated from the following file: