public class RenderContextAccumulator
extends java.lang.Object
Pending state changes can be made at any time, but can only be applied by calling executeChanges() between calls to
begin() and end().
| Constructor and Description |
|---|
RenderContextAccumulator() |
| Modifier and Type | Method and Description |
|---|---|
void |
begin()
Begin tracking GL state.
|
void |
clearAllTextureUnits()
Cancels all pending texture bindings and drops all Texture references held by RenderContextAccumulator.
|
boolean |
clearTextureUnit(int unit)
Cancels any pending texture that is to be bound to the given texture unit.
|
void |
end()
Returns actual OpenGL states to defaults.
|
void |
executeChanges()
Applies the pending state changes and texture bindings to GL.
|
int |
getBlendFuncDstAlpha() |
int |
getBlendFuncDstColor() |
int |
getBlendFuncSrcAlpha() |
int |
getBlendFuncSrcColor() |
int |
getCullFace() |
int |
getDepthFunction() |
float |
getDepthRangeFar() |
float |
getDepthRangeNear() |
boolean |
getFaceCulling() |
boolean |
hasPendingChanges() |
boolean |
isBlendFuncSeparate() |
boolean |
isBlendingEnabled() |
boolean |
isDepthMaskEnabled() |
boolean |
isDepthTestingEnabled() |
boolean |
setBlendEquation(int blendEquation)
Sets the blend equation.
|
boolean |
setBlendEquation(int blendEquationColor,
int blendEquationAlpha)
Sets the blend equations, using separate equations for the color and alpha components.
|
boolean |
setBlendFunction(int sFactor,
int dFactor)
Sets the blendFunc parameters.
|
boolean |
setBlendFunction(int sColorFactor,
int dColorFactor,
int sAlphaFactor,
int dAlphaFactor)
Sets the blendFunc, using separate parameters for the color and alpha components.
|
boolean |
setBlending(boolean enabled)
Enables or disables blending.
|
boolean |
setCullFace(int face)
Sets which face(s) is culled when face culling is enabled.
|
boolean |
setDepthFunction(int depthFunction)
Sets the depth test function and a depth range of 0 to 1.
|
boolean |
setDepthFunction(int depthFunc,
float depthRangeNear,
float depthRangeFar)
Sets the depth test function and range.
|
boolean |
setDepthMasking(boolean enabled)
Enables or disables depth buffer writing.
|
boolean |
setDepthTesting(boolean enabled)
Enables or disables depth testing.
|
boolean |
setFaceCulling(boolean enabled)
Enables or disables face culling.
|
boolean |
setTextureUnit(com.badlogic.gdx.graphics.GLTexture texture,
int unit)
Sets the texture to be bound to the given texture unit.
|
public void begin()
executeChanges().
This call must be matched with a call to end(), which returns OpenGL states to their defaults. The
executeChanges() method may only be called in between begin() and end().
public boolean hasPendingChanges()
public void executeChanges()
public void end()
public boolean setDepthMasking(boolean enabled)
public boolean setDepthTesting(boolean enabled)
public boolean setDepthFunction(int depthFunction)
public boolean setDepthFunction(int depthFunc,
float depthRangeNear,
float depthRangeFar)
public boolean setBlending(boolean enabled)
public boolean setBlendFunction(int sFactor,
int dFactor)
public boolean setBlendFunction(int sColorFactor,
int dColorFactor,
int sAlphaFactor,
int dAlphaFactor)
public boolean setBlendEquation(int blendEquation)
public boolean setBlendEquation(int blendEquationColor,
int blendEquationAlpha)
public boolean setFaceCulling(boolean enabled)
public boolean setCullFace(int face)
public boolean setTextureUnit(com.badlogic.gdx.graphics.GLTexture texture,
int unit)
public boolean clearTextureUnit(int unit)
public void clearAllTextureUnits()
public boolean isDepthMaskEnabled()
public boolean isDepthTestingEnabled()
public int getDepthFunction()
public float getDepthRangeNear()
public float getDepthRangeFar()
public boolean isBlendingEnabled()
public int getBlendFuncSrcColor()
public int getBlendFuncDstColor()
public boolean isBlendFuncSeparate()
public int getBlendFuncSrcAlpha()
public int getBlendFuncDstAlpha()
public boolean getFaceCulling()
public int getCullFace()