#include <View2DShaderGLSL.h>

Public Member Functions | |
| View2DShaderGLSL () | |
| virtual | ~View2DShaderGLSL () |
| virtual void | bind (View2DTexture *texture, int tw, int th) |
| binds/activates the shader | |
| const char * | name () |
| get the shader's name | |
| virtual void | unbind () |
| deactivates the shader | |
| virtual void | destroy () |
| destroy the previous shader | |
Static Public Member Functions | |
| static bool | runsInHardware () |
| returns if the shader is supported and would run in hardware (calling this method requires a valid GL context!) | |
Protected Member Functions | |
| virtual bool | create (View2DTexture *texture) |
| creates the desired shader | |
| bool | create (const char *vertexShader, const char *fragmentShader) |
| creates the shader and returns true if it worked. | |
| void | createCubicShader (std::stringstream &str, bool use16BitLut) |
| void | createNearestShader (std::stringstream &str, bool use16BitLut) |
| void | createLinearShader (std::stringstream &str, bool use16BitLut) |
Static Protected Member Functions | |
| static std::string | getShaderErrors (GLuint shaderId) |
| get current shader error log | |
| static std::string | getProgramErrors (GLuint programId) |
| get current program error log | |
Protected Attributes | |
| ml::GLSLFragmentShader | _fragmentShader |
| ml::GLSLVertexShader | _vertexShader |
| ml::GLSLProgram | _program |
| View2DTextureFilter | _lastFilter |
| size_t | _lastDataSize |
The RGBA LookupTable is loaded into a 2D texture of 256 pixels width and dynamic height. The texture lookups and color interpolation is done with two "assembly" fragment programs, one for bilinear interpolation and one for nearest neigbor interpolation. The shader interacts with the View2DTexture and it's bind message is called by each subtexture that the View2DTexture renders. This is done because the size of the textures changes and this size is needed as local parameters in the fragment program.
Definition at line 31 of file View2DShaderGLSL.h.
| View2DShaderGLSL::View2DShaderGLSL | ( | ) |
| virtual View2DShaderGLSL::~View2DShaderGLSL | ( | ) | [virtual] |
| virtual void View2DShaderGLSL::bind | ( | View2DTexture * | texture, | |
| int | tw, | |||
| int | th | |||
| ) | [virtual] |
| bool View2DShaderGLSL::create | ( | const char * | vertexShader, | |
| const char * | fragmentShader | |||
| ) | [protected] |
creates the shader and returns true if it worked.
| virtual bool View2DShaderGLSL::create | ( | View2DTexture * | texture | ) | [protected, virtual] |
creates the desired shader
| void View2DShaderGLSL::createCubicShader | ( | std::stringstream & | str, | |
| bool | use16BitLut | |||
| ) | [protected] |
| void View2DShaderGLSL::createLinearShader | ( | std::stringstream & | str, | |
| bool | use16BitLut | |||
| ) | [protected] |
| void View2DShaderGLSL::createNearestShader | ( | std::stringstream & | str, | |
| bool | use16BitLut | |||
| ) | [protected] |
| virtual void View2DShaderGLSL::destroy | ( | ) | [virtual] |
| static std::string View2DShaderGLSL::getProgramErrors | ( | GLuint | programId | ) | [static, protected] |
get current program error log
| static std::string View2DShaderGLSL::getShaderErrors | ( | GLuint | shaderId | ) | [static, protected] |
get current shader error log
| const char* View2DShaderGLSL::name | ( | ) | [inline, virtual] |
| static bool View2DShaderGLSL::runsInHardware | ( | ) | [static] |
returns if the shader is supported and would run in hardware (calling this method requires a valid GL context!)
| virtual void View2DShaderGLSL::unbind | ( | ) | [virtual] |
ml::GLSLFragmentShader View2DShaderGLSL::_fragmentShader [protected] |
Definition at line 68 of file View2DShaderGLSL.h.
size_t View2DShaderGLSL::_lastDataSize [protected] |
Definition at line 73 of file View2DShaderGLSL.h.
View2DTextureFilter View2DShaderGLSL::_lastFilter [protected] |
Definition at line 72 of file View2DShaderGLSL.h.
ml::GLSLProgram View2DShaderGLSL::_program [protected] |
Definition at line 70 of file View2DShaderGLSL.h.
ml::GLSLVertexShader View2DShaderGLSL::_vertexShader [protected] |
Definition at line 69 of file View2DShaderGLSL.h.
1.5.8