KWin
|
#include <glshader.h>
Public Types | |
enum | Flags { NoFlags = 0 , ExplicitLinking = (1 << 0) } |
enum class | Mat3Uniform |
enum class | Mat4Uniform { TextureMatrix = 0 , ProjectionMatrix , ModelViewMatrix , ModelViewProjectionMatrix , WindowTransformation , ScreenTransformation , ColorimetryTransformation , MatrixCount } |
enum class | Vec2Uniform { Offset , Vec2UniformCount } |
enum class | Vec3Uniform { PrimaryBrightness = 0 } |
enum class | Vec4Uniform { ModulationConstant , Vec4UniformCount } |
enum class | FloatUniform { Saturation , MaxHdrBrightness , SdrBrightness , FloatUniformCount } |
enum class | IntUniform { AlphaToOne , TextureWidth , TextureHeight , SourceNamedTransferFunction , DestinationNamedTransferFunction , Sampler , Sampler1 , IntUniformCount } |
enum class | ColorUniform { Color , ColorUniformCount } |
Public Member Functions | |
GLShader (const QString &vertexfile, const QString &fragmentfile, unsigned int flags=NoFlags) | |
~GLShader () | |
bool | isValid () const |
void | bindAttributeLocation (const char *name, int index) |
void | bindFragDataLocation (const char *name, int index) |
bool | link () |
int | uniformLocation (const char *name) |
bool | setUniform (const char *name, float value) |
bool | setUniform (const char *name, int value) |
bool | setUniform (const char *name, const QVector2D &value) |
bool | setUniform (const char *name, const QVector3D &value) |
bool | setUniform (const char *name, const QVector4D &value) |
bool | setUniform (const char *name, const QMatrix4x4 &value) |
bool | setUniform (const char *name, const QColor &color) |
bool | setUniform (int location, float value) |
bool | setUniform (int location, int value) |
bool | setUniform (int location, int xValue, int yValue, int zValue) |
bool | setUniform (int location, const QVector2D &value) |
bool | setUniform (int location, const QVector3D &value) |
bool | setUniform (int location, const QVector4D &value) |
bool | setUniform (int location, const QMatrix3x3 &value) |
bool | setUniform (int location, const QMatrix4x4 &value) |
bool | setUniform (int location, const QColor &value) |
int | attributeLocation (const char *name) |
bool | setAttribute (const char *name, float value) |
QMatrix4x4 | getUniformMatrix4x4 (const char *name) |
bool | setUniform (Mat3Uniform uniform, const QMatrix3x3 &value) |
bool | setUniform (Mat4Uniform uniform, const QMatrix4x4 &matrix) |
bool | setUniform (Vec2Uniform uniform, const QVector2D &value) |
bool | setUniform (Vec3Uniform uniform, const QVector3D &value) |
bool | setUniform (Vec4Uniform uniform, const QVector4D &value) |
bool | setUniform (FloatUniform uniform, float value) |
bool | setUniform (IntUniform uniform, int value) |
bool | setUniform (ColorUniform uniform, const QVector4D &value) |
bool | setUniform (ColorUniform uniform, const QColor &value) |
bool | setColorspaceUniforms (const ColorDescription &src, const ColorDescription &dst) |
bool | setColorspaceUniformsFromSRGB (const ColorDescription &dst) |
bool | setColorspaceUniformsToSRGB (const ColorDescription &src) |
Protected Member Functions | |
GLShader (unsigned int flags=NoFlags) | |
bool | loadFromFiles (const QString &vertexfile, const QString &fragmentfile) |
bool | load (const QByteArray &vertexSource, const QByteArray &fragmentSource) |
const QByteArray | prepareSource (GLenum shaderType, const QByteArray &sourceCode) const |
bool | compile (GLuint program, GLenum shaderType, const QByteArray &sourceCode) const |
void | bind () |
void | unbind () |
void | resolveLocations () |
Friends | |
class | ShaderManager |
Definition at line 25 of file glshader.h.
|
strong |
Enumerator | |
---|---|
Color | |
ColorUniformCount |
Definition at line 120 of file glshader.h.
Enumerator | |
---|---|
NoFlags | |
ExplicitLinking |
Definition at line 28 of file glshader.h.
|
strong |
Enumerator | |
---|---|
Saturation | |
MaxHdrBrightness | |
SdrBrightness | |
FloatUniformCount |
Definition at line 102 of file glshader.h.
|
strong |
Enumerator | |
---|---|
AlphaToOne |
|
TextureWidth | |
TextureHeight | |
SourceNamedTransferFunction | |
DestinationNamedTransferFunction | |
Sampler | |
Sampler1 | |
IntUniformCount |
Definition at line 109 of file glshader.h.
|
strong |
Definition at line 74 of file glshader.h.
|
strong |
Enumerator | |
---|---|
TextureMatrix | |
ProjectionMatrix | |
ModelViewMatrix | |
ModelViewProjectionMatrix | |
WindowTransformation | |
ScreenTransformation | |
ColorimetryTransformation | |
MatrixCount |
Definition at line 77 of file glshader.h.
|
strong |
Enumerator | |
---|---|
Offset | |
Vec2UniformCount |
Definition at line 88 of file glshader.h.
|
strong |
Enumerator | |
---|---|
PrimaryBrightness |
Definition at line 93 of file glshader.h.
|
strong |
Enumerator | |
---|---|
ModulationConstant | |
Vec4UniformCount |
Definition at line 97 of file glshader.h.
KWin::GLShader::GLShader | ( | const QString & | vertexfile, |
const QString & | fragmentfile, | ||
unsigned int | flags = NoFlags ) |
Definition at line 29 of file glshader.cpp.
KWin::GLShader::~GLShader | ( | ) |
Definition at line 38 of file glshader.cpp.
|
protected |
Definition at line 21 of file glshader.cpp.
int KWin::GLShader::attributeLocation | ( | const char * | name | ) |
Definition at line 415 of file glshader.cpp.
|
protected |
Definition at line 195 of file glshader.cpp.
void KWin::GLShader::bindAttributeLocation | ( | const char * | name, |
int | index ) |
Definition at line 183 of file glshader.cpp.
void KWin::GLShader::bindFragDataLocation | ( | const char * | name, |
int | index ) |
Definition at line 188 of file glshader.cpp.
|
protected |
Definition at line 109 of file glshader.cpp.
QMatrix4x4 KWin::GLShader::getUniformMatrix4x4 | ( | const char * | name | ) |
|
inline |
Definition at line 36 of file glshader.h.
bool KWin::GLShader::link | ( | ) |
Definition at line 64 of file glshader.cpp.
|
protected |
Definition at line 153 of file glshader.cpp.
|
protected |
Definition at line 45 of file glshader.cpp.
|
protected |
Definition at line 94 of file glshader.cpp.
|
protected |
Definition at line 205 of file glshader.cpp.
bool KWin::GLShader::setAttribute | ( | const char * | name, |
float | value ) |
Definition at line 421 of file glshader.cpp.
bool KWin::GLShader::setColorspaceUniforms | ( | const ColorDescription & | src, |
const ColorDescription & | dst ) |
Definition at line 447 of file glshader.cpp.
bool KWin::GLShader::setColorspaceUniformsFromSRGB | ( | const ColorDescription & | dst | ) |
Definition at line 457 of file glshader.cpp.
bool KWin::GLShader::setColorspaceUniformsToSRGB | ( | const ColorDescription & | src | ) |
Definition at line 462 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | ColorUniform | uniform, |
const QColor & | value ) |
Definition at line 295 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | ColorUniform | uniform, |
const QVector4D & | value ) |
Definition at line 289 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | const char * | name, |
const QColor & | color ) |
Definition at line 337 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | const char * | name, |
const QMatrix4x4 & | value ) |
Definition at line 331 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | const char * | name, |
const QVector2D & | value ) |
Definition at line 313 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | const char * | name, |
const QVector3D & | value ) |
Definition at line 319 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | const char * | name, |
const QVector4D & | value ) |
Definition at line 325 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | const char * | name, |
float | value ) |
Definition at line 301 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | const char * | name, |
int | value ) |
Definition at line 307 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | FloatUniform | uniform, |
float | value ) |
Definition at line 277 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | int | location, |
const QColor & | value ) |
Definition at line 407 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | int | location, |
const QMatrix3x3 & | value ) |
Definition at line 391 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | int | location, |
const QMatrix4x4 & | value ) |
Definition at line 399 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | int | location, |
const QVector2D & | value ) |
Definition at line 367 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | int | location, |
const QVector3D & | value ) |
Definition at line 375 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | int | location, |
const QVector4D & | value ) |
Definition at line 383 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | int | location, |
float | value ) |
Definition at line 343 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | int | location, |
int | value ) |
Definition at line 351 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | int | location, |
int | xValue, | ||
int | yValue, | ||
int | zValue ) |
Definition at line 359 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | IntUniform | uniform, |
int | value ) |
Definition at line 283 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | Mat3Uniform | uniform, |
const QMatrix3x3 & | value ) |
Definition at line 247 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | Mat4Uniform | uniform, |
const QMatrix4x4 & | matrix ) |
Definition at line 253 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | Vec2Uniform | uniform, |
const QVector2D & | value ) |
Definition at line 259 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | Vec3Uniform | uniform, |
const QVector3D & | value ) |
Definition at line 265 of file glshader.cpp.
bool KWin::GLShader::setUniform | ( | Vec4Uniform | uniform, |
const QVector4D & | value ) |
Definition at line 271 of file glshader.cpp.
|
protected |
Definition at line 200 of file glshader.cpp.
int KWin::GLShader::uniformLocation | ( | const char * | name | ) |
Definition at line 241 of file glshader.cpp.
|
friend |
Definition at line 163 of file glshader.h.