Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
|
OpenGL Region
renderer.
More...
#include <GraphRenderer.hpp>
Public Member Functions | |
const void | clearHintBits (const int mask) |
const void | destroy (const GL2ES2 gl) |
Deletes all ShaderProgram s and nullifies its references including RenderState#destroy(GL2ES2) . | |
const void | enable (const GL2ES2 gl, const bool enable) |
Enabling or disabling the RenderState 's current shader program . | |
const void | enable (const GL2ES2 gl, const bool enable, const GLCallback enableCB, const GLCallback disableCB) |
Same as enable(GL2ES2, bool) but allowing to force GLCallback s off. | |
const bool | equals (const Object other) |
const int | getAAQuality () |
Returns pass2 AA-quality rendering value for Graph Region AA render-modes : Region#VBAA_RENDERING_BIT . | |
const Frustum | getClipFrustum () |
Returns the optional Mv-premultiplied clipping Frustum or null if unused. | |
const Vec4f | getColorStatic (const Vec4f rgbaColor) |
const int | getHeight () |
Return height of current viewport. | |
const PMVMatrix4f | getMatrix () |
Borrow the current PMVMatrix4f . | |
const RenderState | getRenderState () |
Return the RenderState composition. | |
const int | getSampleCount () |
Returns pass2 AA sample count for Graph Region AA render-modes : VBAA_RENDERING_BIT or Region#MSAA_RENDERING_BIT . | |
const Recti | getViewport () |
Borrows the current Rect4i viewport w/o copying. | |
const Recti | getViewport (const Recti target) |
Copies the current Rect4i viewport in given target and returns it for chaining. | |
const float | getWeight () |
const int | getWidth () |
Return width of current viewport. | |
const int | hashCode () |
const bool | hintBitsSet (const int mask) |
const void | init (const GL2ES2 gl) throws GLException |
Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext if not initialized yet. | |
const bool | isInitialized () |
const bool | isVBOSupported () |
const void | reshapeNotify (const int x, const int y, const int width, const int height) |
No PMVMatrix4f operation is performed here. | |
const void | reshapeOrtho (const int width, const int height, const float near, const float far) |
Orthogonal projection, method also calls reshapeNotify(int, int, int, int) . | |
const void | reshapePerspective (const float angle_rad, const int width, const int height, const float near, const float far) |
Perspective projection, method also calls reshapeNotify(int, int, int, int) . | |
const int | setAAQuality (const int v) |
Sets pass2 AA-quality rendering value clipped to the range [Region#MIN_AA_QUALITY ..Region#MAX_AA_QUALITY ] for Graph Region AA render-modes : Region#VBAA_RENDERING_BIT . | |
const void | setClipFrustum (const Frustum clipFrustum) |
Set the optional clipping Frustum , which shall be pre-multiplied with the Mv-matrix or null to disable. | |
const void | setColorStatic (const float r, const float g, const float b, const float a) |
const void | setColorStatic (const Vec4f rgbaColor) |
const void | setHintBits (const int mask) |
const int | setSampleCount (const int v) |
Sets pass2 AA sample count clipped to the range [Region#MIN_AA_SAMPLE_COUNT ..Region#MAX_AA_SAMPLE_COUNT ] for Graph Region AA render-modes : VBAA_RENDERING_BIT or Region#MSAA_RENDERING_BIT . | |
const void | setWeight (const float v) |
String | toString () |
const bool | useShaderProgram (const GL2ES2 gl, const int renderModes, const bool pass1, const TextureSequence colorTexSeq) |
Generate, selects and caches the desired Curve-Graph ShaderProgram according to the given parameters. | |
Static Public Member Functions | |
static RegionRenderer | create () |
Create a hardware accelerated RegionRenderer including its RenderState composition. | |
static RegionRenderer | create (const GLCallback enableCallback, const GLCallback disableCallback) |
Create a hardware accelerated RegionRenderer including its RenderState composition. | |
static RegionRenderer | create (const PMVMatrix4f sharedPMVMatrix, const GLCallback enableCallback, const GLCallback disableCallback) |
Create a hardware accelerated RegionRenderer including its RenderState composition. | |
Static Public Attributes | |
static const GLCallback | defaultBlendDisable |
Default GL#GL_BLEND disable GLCallback , simply turning-off the GL#GL_BLEND state and turning-on depth writing via GL#glDepthMask(bool) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set. | |
static const GLCallback | defaultBlendEnable |
Default GL#GL_BLEND enable GLCallback , turning-off depth writing via GL#glDepthMask(bool) if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set and turning-on the GL#GL_BLEND state. | |
Protected Member Functions | |
RegionRenderer (const GLCallback enableCallback, const GLCallback disableCallback) | |
RegionRenderer (const PMVMatrix4f sharedPMVMatrix, const GLCallback enableCallback, const GLCallback disableCallback) | |
Static Protected Attributes | |
static const bool | DEBUG = Region.DEBUG |
static const bool | DEBUG_ALL_EVENT = Region.DEBUG_ALL_EVENT |
static const bool | DEBUG_INSTANCE = Region.DEBUG_INSTANCE |
OpenGL Region
renderer.
All Region
rendering operations utilize a RegionRenderer.
The RegionRenderer owns its RenderState
, a composition.
The RegionRenderer manages and own all used ShaderProgram
s, a composition.
At its destruction
, all ShaderProgram
s and its RenderState
will be destroyed and released.
Definition at line 44 of file GraphRenderer.hpp.
|
inlineprotected |
|
inlineprotected |
Definition at line 204 of file GraphRenderer.hpp.
|
inlinestatic |
Create a hardware accelerated RegionRenderer including its RenderState
composition.
The optional GLCallback
s enableCallback
and disableCallback
maybe used to issue certain tasks at enable(GL2ES2, bool)
.
For example, instances defaultBlendEnable
and defaultBlendDisable
can be utilized to enable and disable GL#GL_BLEND
.
Definition at line 129 of file GraphRenderer.hpp.
|
inlinestatic |
Create a hardware accelerated RegionRenderer including its RenderState
composition.
The optional GLCallback
s enableCallback
and disableCallback
maybe used to issue certain tasks at enable(GL2ES2, bool)
.
For example, instances defaultBlendEnable
and defaultBlendDisable
can be utilized to enable and disable GL#GL_BLEND
.
enableCallback | optional GLCallback , if not null will be issued at init(gl) and enable(gl, true) . |
disableCallback | optional GLCallback , if not null will be issued at enable(gl, false) . |
Definition at line 148 of file GraphRenderer.hpp.
|
inlinestatic |
Create a hardware accelerated RegionRenderer including its RenderState
composition.
The optional GLCallback
s enableCallback
and disableCallback
maybe used to issue certain tasks at enable(GL2ES2, bool)
.
For example, instances defaultBlendEnable
and defaultBlendDisable
can be utilized to enable and disable GL#GL_BLEND
.
sharedPMVMatrix | optional shared PMVMatrix4f to be used for the RenderState composition. |
enableCallback | optional GLCallback , if not null will be issued at init(gl) and enable(gl, true) . |
disableCallback | optional GLCallback , if not null will be issued at enable(gl, false) . |
Definition at line 168 of file GraphRenderer.hpp.
|
inline |
Definition at line 182 of file GraphRenderer.hpp.
Copies the current Rect4i viewport in given target and returns it for chaining.
Definition at line 185 of file GraphRenderer.hpp.
|
inline |
Borrows the current Rect4i viewport w/o copying.
Definition at line 190 of file GraphRenderer.hpp.
|
inline |
Return width of current viewport.
Definition at line 194 of file GraphRenderer.hpp.
|
inline |
Return height of current viewport.
Definition at line 196 of file GraphRenderer.hpp.
|
inline |
|
inline |
Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext if not initialized yet.
Disables the renderer via enable(GL2ES2, bool)
to remove any side-effects, ie ShaderState incl. shader program.
Shall be called once before at initialization before a draw()
method, e.g. RegionRenderer#draw(GL2ES2, Region)
gl | referencing the current GLContext to which the ShaderState is bound to |
GLException | if initialization failed |
Definition at line 230 of file GraphRenderer.hpp.
|
inline |
Deletes all ShaderProgram
s and nullifies its references including RenderState#destroy(GL2ES2)
.
Definition at line 256 of file GraphRenderer.hpp.
|
inline |
Return the RenderState
composition.
Definition at line 282 of file GraphRenderer.hpp.
|
inline |
Borrow the current PMVMatrix4f
.
Definition at line 289 of file GraphRenderer.hpp.
|
inline |
Definition at line 291 of file GraphRenderer.hpp.
|
inline |
Definition at line 293 of file GraphRenderer.hpp.
Definition at line 295 of file GraphRenderer.hpp.
|
inline |
Definition at line 297 of file GraphRenderer.hpp.
|
inline |
Definition at line 299 of file GraphRenderer.hpp.
|
inline |
Sets pass2 AA-quality rendering value clipped to the range [Region#MIN_AA_QUALITY
..Region#MAX_AA_QUALITY
] for Graph Region AA render-modes
: Region#VBAA_RENDERING_BIT
.
Definition at line 302 of file GraphRenderer.hpp.
|
inline |
Returns pass2 AA-quality rendering value for Graph Region AA render-modes
: Region#VBAA_RENDERING_BIT
.
Definition at line 304 of file GraphRenderer.hpp.
|
inline |
Sets pass2 AA sample count clipped to the range [Region#MIN_AA_SAMPLE_COUNT
..Region#MAX_AA_SAMPLE_COUNT
] for Graph Region AA render-modes
: VBAA_RENDERING_BIT
or Region#MSAA_RENDERING_BIT
.
Definition at line 307 of file GraphRenderer.hpp.
|
inline |
Returns pass2 AA sample count for Graph Region AA render-modes
: VBAA_RENDERING_BIT
or Region#MSAA_RENDERING_BIT
.
Definition at line 309 of file GraphRenderer.hpp.
|
inline |
Set the optional clipping Frustum
, which shall be pre-multiplied with the Mv-matrix or null to disable.
Definition at line 312 of file GraphRenderer.hpp.
|
inline |
Returns the optional Mv-premultiplied clipping Frustum
or null if unused.
Definition at line 314 of file GraphRenderer.hpp.
|
inline |
Definition at line 316 of file GraphRenderer.hpp.
|
inline |
Definition at line 318 of file GraphRenderer.hpp.
|
inline |
Definition at line 320 of file GraphRenderer.hpp.
|
inline |
Enabling or disabling the RenderState
's current shader program
.
useShaderProgram(GL2ES2, int, bool, TextureSequence)
generates, selects and caches the desired Curve-Graph ShaderProgram
and sets it current
in the RenderState
composition.
In case enable and disable GLCallback
s are setup via create(Vertex.Factory<? extends Vertex>, RenderState, GLCallback, GLCallback)
, they will be called before toggling the shader program.
gl | current GL object |
enable | if true enable the current ShaderProgram , otherwise disable. |
Definition at line 341 of file GraphRenderer.hpp.
|
inline |
Same as enable(GL2ES2, bool)
but allowing to force GLCallback
s off.
gl | current GL object |
enable | if true enable the current ShaderProgram , otherwise disable. |
enableCB | explicit GLCallback for enable |
disableCB | explicit GLCallback for disable |
Definition at line 353 of file GraphRenderer.hpp.
|
inline |
No PMVMatrix4f operation is performed here.
Definition at line 372 of file GraphRenderer.hpp.
|
inline |
Perspective projection, method also calls reshapeNotify(int, int, int, int)
.
angle_rad | perspective angle in radians |
width | viewport width |
height | viewport height |
near | projection z-near |
far | projection z-far |
Definition at line 384 of file GraphRenderer.hpp.
|
inline |
Orthogonal projection, method also calls reshapeNotify(int, int, int, int)
.
width | viewport width |
height | viewport height |
near | projection z-near |
far | projection z-far |
Definition at line 399 of file GraphRenderer.hpp.
|
inline |
Definition at line 547 of file GraphRenderer.hpp.
|
inline |
Definition at line 549 of file GraphRenderer.hpp.
|
inline |
Definition at line 566 of file GraphRenderer.hpp.
|
inline |
Generate, selects and caches the desired Curve-Graph ShaderProgram
according to the given parameters.
The newly generated or cached ShaderProgram
is set current
in the RenderState
composition and can be retrieved via RenderState#getShaderProgram()
.
gl | |
renderModes | |
pass1 | |
colorTexSeq |
Definition at line 639 of file GraphRenderer.hpp.
|
staticprotected |
Definition at line 46 of file GraphRenderer.hpp.
|
staticprotected |
Definition at line 47 of file GraphRenderer.hpp.
|
staticprotected |
Definition at line 48 of file GraphRenderer.hpp.
|
static |
Default GL#GL_BLEND
enable GLCallback
, turning-off depth writing via GL#glDepthMask(bool)
if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED
is set and turning-on the GL#GL_BLEND
state.
Implementation also sets RenderState
's blending bit-hint
, which will cause GLRegion's draw-method
to set the proper blend-function
and the clear-color to transparent-black in case of multipass
FBO rendering.
Definition at line 81 of file GraphRenderer.hpp.
|
static |
Default GL#GL_BLEND
disable GLCallback
, simply turning-off the GL#GL_BLEND
state and turning-on depth writing via GL#glDepthMask(bool)
if RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED
is set.
Implementation also clears RenderState
's blending bit-hint
.
Definition at line 105 of file GraphRenderer.hpp.