KWin
KGLLib::Shader Class Reference
#include <shader.h>

Detailed Description
Shader class.Encapsulates a shader object. Note that shaders are only intermediate objects used to create Program objects. For simple use cases, you can use Program class which can automatically create and use necessary Shader objects.
Definition at line 38 of file shader.h.
Public Member Functions | |
| bool | compile () |
| char * | compileLog () const |
| GLuint | glId () const |
| bool | isCompiled () const |
| bool | isValid () const |
| void | setSource (const QByteArray &source) |
| void | setSource (const QString &source) |
| Shader (GLenum type, const QString &filename) | |
| Shader (GLenum type) | |
| GLenum | type () const |
| virtual | ~Shader () |
Protected Member Functions | |
| void | init (GLenum type) |
Protected Attributes | |
| bool | mCompiled |
| char * | mCompileLog |
| GLuint | mGLId |
| GLenum | mType |
| bool | mValid |
Constructor & Destructor Documentation
| KGLLib::Shader::Shader | ( | GLenum | type | ) |
Creates a shader of given type.
You need to manually call setSource() and compile() before the shader can be added to a Program.
Definition at line 26 of file shader.cpp.
Loads shader of given type from given file.
Loaded shader is automatically compiled, so if the compilation succeeds, you can add it to a Program object.
Definition at line 31 of file shader.cpp.
| KGLLib::Shader::~Shader | ( | ) | [virtual] |
Deletes a shader.
Shaders can be deleted after they are added to a Program and the program is linked.
Definition at line 44 of file shader.cpp.
Member Function Documentation
| bool KGLLib::Shader::compile | ( | ) |
Compiles the shader.
If compilation succeeds, you can add it to a Program object. If compilation fails, you can see the error using compileLog() method.
Definition at line 74 of file shader.cpp.
| char* KGLLib::Shader::compileLog | ( | ) | const [inline] |
| void KGLLib::Shader::init | ( | GLenum | type | ) | [protected] |
Definition at line 50 of file shader.cpp.
| void KGLLib::Shader::setSource | ( | const QByteArray & | source | ) |
Definition at line 64 of file shader.cpp.
| void KGLLib::Shader::setSource | ( | const QString & | source | ) |
Sets shader source to source.
Next you will need to compile the shader.
Definition at line 59 of file shader.cpp.
Member Data Documentation
bool KGLLib::Shader::mCompiled [protected] |
char* KGLLib::Shader::mCompileLog [protected] |
GLuint KGLLib::Shader::mGLId [protected] |
GLenum KGLLib::Shader::mType [protected] |
bool KGLLib::Shader::mValid [protected] |
The documentation for this class was generated from the following files:
KDE 4.2 API Reference