Used to create custom shaders for use with an openGL 2D rendering context. More...
|OpenGLGraphicsContextCustomShader (const String &fragmentShaderCode)|
|Creates a custom shader. More...|
|OpenGLShaderProgram *||getProgram (LowLevelGraphicsContext &) const|
|Returns the program, if it has been linked and is active. More...|
|void||fillRect (LowLevelGraphicsContext &, const Rectangle< int > &area) const|
|Applies the shader to a rectangle within the graphics context. More...|
|Result||checkCompilation (LowLevelGraphicsContext &)|
|Attempts to compile the program if necessary, and returns an error message if it fails. More...|
|const String &||getFragmentShaderCode () const noexcept|
|Returns the code that was used to create this object. More...|
Used to create custom shaders for use with an openGL 2D rendering context.
Given a GL-based rendering context, you can write a fragment shader that applies some kind of per-pixel effect.
Constructor & Destructor Documentation
|OpenGLGraphicsContextCustomShader::OpenGLGraphicsContextCustomShader||(||const String &||fragmentShaderCode||)|
Creates a custom shader.
The shader code will not be compiled until actually needed, so it's OK to call this constructor when no GL context is active.
The code should be a normal fragment shader. As well as the usual GLSL variables, there is also an automatically declared varying vec2 called "pixelPos", which indicates the pixel position within the graphics context of the pixel being drawn. There is also a varying value "pixelAlpha", which indicates the alpha by which the pixel should be multiplied, so that the edges of any clip-region masks are anti-aliased correctly.
Member Function Documentation
|OpenGLShaderProgram* OpenGLGraphicsContextCustomShader::getProgram||(||LowLevelGraphicsContext &||)||const|
Returns the program, if it has been linked and is active.
This can be called when you're about to use fillRect, to set up any uniforms/textures that the program may require.
|void OpenGLGraphicsContextCustomShader::fillRect||(||LowLevelGraphicsContext &||,|
|const Rectangle< int > &||area|
Applies the shader to a rectangle within the graphics context.
Attempts to compile the program if necessary, and returns an error message if it fails.
Returns the code that was used to create this object.
The documentation for this struct was generated from the following file:
Generated on Fri Jan 12 2018 09:51:21 for JUCE by 1.8.13