public class RegionRenderer extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
RegionRenderer.GLCallback
May be passed to
RegionRenderer ctor ,
e.g. |
Modifier and Type | Field and Description |
---|---|
static RegionRenderer.GLCallback |
defaultBlendDisable
Default
GL.GL_BLEND disable RegionRenderer.GLCallback ,
simply turning-off the GL.GL_BLEND state
and turning-on depth writing via GL.glDepthMask(boolean) if RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set. |
static RegionRenderer.GLCallback |
defaultBlendEnable
Default
GL.GL_BLEND enable RegionRenderer.GLCallback ,
turning-off depth writing via GL.glDepthMask(boolean) if RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED is set
and turning-on the GL.GL_BLEND state. |
Modifier and Type | Method and Description |
---|---|
static RegionRenderer |
create(RenderState rs,
RegionRenderer.GLCallback enableCallback,
RegionRenderer.GLCallback disableCallback)
Create a Hardware accelerated Region Renderer.
|
void |
destroy(GL2ES2 gl) |
void |
enable(GL2ES2 gl,
boolean enable)
Enabling or disabling the
RenderState 's
shader program . |
int |
getHeight()
Return height of current viewport
|
PMVMatrix |
getMatrix() |
RenderState |
getRenderState() |
int |
getWidth()
Return width of current viewport
|
void |
init(GL2ES2 gl,
int renderModes)
Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext
if not initialized yet.
|
boolean |
isInitialized() |
boolean |
isVBOSupported() |
void |
reshapeNotify(int width,
int height)
No PMVMatrix operation is performed here.
|
void |
reshapeOrtho(int width,
int height,
float near,
float far) |
void |
reshapePerspective(float angle,
int width,
int height,
float near,
float far) |
boolean |
useShaderProgram(GL2ES2 gl,
int renderModes,
boolean pass1,
int quality,
int sampleCount,
TextureSequence colorTexSeq) |
public static final RegionRenderer.GLCallback defaultBlendEnable
GL.GL_BLEND
enable RegionRenderer.GLCallback
,
turning-off depth writing via GL.glDepthMask(boolean)
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.
public static final RegionRenderer.GLCallback defaultBlendDisable
GL.GL_BLEND
disable RegionRenderer.GLCallback
,
simply turning-off the GL.GL_BLEND
state
and turning-on depth writing via GL.glDepthMask(boolean)
if RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED
is set.
Implementation also clears RenderState
's blending bit-hint
.
public static RegionRenderer create(RenderState rs, RegionRenderer.GLCallback enableCallback, RegionRenderer.GLCallback disableCallback)
The optional RegionRenderer.GLCallback
s enableCallback
and disableCallback
maybe used to issue certain tasks at enable(GL2ES2, boolean)
.
For example, instances defaultBlendEnable
and defaultBlendDisable
can be utilized to enable and disable GL.GL_BLEND
.
rs
- the used RenderState
enableCallback
- optional RegionRenderer.GLCallback
, if not null
will be issued at
init(gl)
and enable(gl, true)
.disableCallback
- optional RegionRenderer.GLCallback
, if not null
will be issued at
enable(gl, false)
.enable(GL2ES2, boolean)
public final boolean isInitialized()
public final int getWidth()
public final int getHeight()
public final PMVMatrix getMatrix()
public final boolean isVBOSupported()
public final void init(GL2ES2 gl, int renderModes) throws GLException
Leaves the renderer enabled, ie ShaderState.
Shall be called by a draw()
method, e.g. RegionRenderer#draw(GL2ES2, Region, int)
gl
- referencing the current GLContext to which the ShaderState is bound torenderModes
- GLException
- if initialization failedpublic final void destroy(GL2ES2 gl)
public final RenderState getRenderState()
public final void enable(GL2ES2 gl, boolean enable)
RenderState
's
shader program
.
In case enable and disable RegionRenderer.GLCallback
s are setup via create(RenderState, GLCallback, GLCallback)
,
they will be called before toggling the shader program.
public final void reshapeNotify(int width, int height)
public final void reshapePerspective(float angle, int width, int height, float near, float far)
public final void reshapeOrtho(int width, int height, float near, float far)
public final boolean useShaderProgram(GL2ES2 gl, int renderModes, boolean pass1, int quality, int sampleCount, TextureSequence colorTexSeq)
gl
- renderModes
- pass1
- quality
- sampleCount
- colorTexSeq
- Copyright 2010 JogAmp Community.