#include <View2DShaderARB.h>

Public Member Functions | |
| View2DShaderARB () | |
| virtual | ~View2DShaderARB () |
| 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 *shader, ml::GLFragmentProgramARB &program) |
creates the shader and sets program to the id of the shader, returns true if the shaders are supported in hardware | |
| void | createCubicShader (std::stringstream &str, bool use16BitLut) |
| void | createNearestShader (std::stringstream &str, bool use16BitLut) |
| void | createLinearShader (std::stringstream &str, bool use16BitLut) |
Protected Attributes | |
| ml::GLFragmentProgramARB | _currentShader |
| the vertex program id | |
| 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 29 of file View2DShaderARB.h.
| View2DShaderARB::View2DShaderARB | ( | ) |
| virtual View2DShaderARB::~View2DShaderARB | ( | ) | [virtual] |
| virtual void View2DShaderARB::bind | ( | View2DTexture * | texture, | |
| int | tw, | |||
| int | th | |||
| ) | [virtual] |
| bool View2DShaderARB::create | ( | const char * | shader, | |
| ml::GLFragmentProgramARB & | program | |||
| ) | [protected] |
creates the shader and sets program to the id of the shader, returns true if the shaders are supported in hardware
| virtual bool View2DShaderARB::create | ( | View2DTexture * | texture | ) | [protected, virtual] |
creates the desired shader
| void View2DShaderARB::createCubicShader | ( | std::stringstream & | str, | |
| bool | use16BitLut | |||
| ) | [protected] |
| void View2DShaderARB::createLinearShader | ( | std::stringstream & | str, | |
| bool | use16BitLut | |||
| ) | [protected] |
| void View2DShaderARB::createNearestShader | ( | std::stringstream & | str, | |
| bool | use16BitLut | |||
| ) | [protected] |
| virtual void View2DShaderARB::destroy | ( | ) | [virtual] |
| const char* View2DShaderARB::name | ( | ) | [inline, virtual] |
| static bool View2DShaderARB::runsInHardware | ( | ) | [static] |
returns if the shader is supported and would run in hardware (calling this method requires a valid GL context!)
| virtual void View2DShaderARB::unbind | ( | ) | [virtual] |
ml::GLFragmentProgramARB View2DShaderARB::_currentShader [protected] |
size_t View2DShaderARB::_lastDataSize [protected] |
Definition at line 64 of file View2DShaderARB.h.
View2DTextureFilter View2DShaderARB::_lastFilter [protected] |
Definition at line 63 of file View2DShaderARB.h.
1.5.8