APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.graphics.g3d.utils

public Class RenderContext

extends Object
Class Inheritance
Imports
com.badlogic.gdx.Gdx, com.badlogic.gdx.graphics.GL20

Manages OpenGL state and tries to reduce state changes. Uses a TextureBinder to reduce texture binds as well. Call begin() to setup the context, call end() to undo all state changes. Use the setters to change state, use textureBinder to bind textures.
Author
badlogic, Xoppa

Field Summary

Modifier and TypeField and Description
private int
private int
private boolean
private int
private int
private int
private int
private boolean
private float
private float
public final TextureBinder
textureBinder

used to bind textures

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
begin()

Sets up the render context, must be matched with a call to end().

public void
end()

Resets all changed OpenGL states to their defaults.

public void
setBlending(final boolean enabled, final int sFactor, final int dFactor)

public void
setBlending(final boolean enabled, final int sRgbFactor, final int dRgbFactor, final int sAlphaFactor, final int dAlphaFactor)

public void
setCullFace(final int face)

public void
setDepthMask(final boolean depthMask)

public void
setDepthTest(final int depthFunction)

public void
setDepthTest(final int depthFunction, final float depthRangeNear, final float depthRangeFar)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blendDestAlphaFactorback to summary
private int blendDestAlphaFactor
blendDestRgbFactorback to summary
private int blendDestRgbFactor
blendingback to summary
private boolean blending
blendSourceAlphaFactorback to summary
private int blendSourceAlphaFactor
blendSourceRgbFactorback to summary
private int blendSourceRgbFactor
cullFaceback to summary
private int cullFace
depthFuncback to summary
private int depthFunc
depthMaskback to summary
private boolean depthMask
depthRangeFarback to summary
private float depthRangeFar
depthRangeNearback to summary
private float depthRangeNear
textureBinderback to summary
public final TextureBinder textureBinder

used to bind textures

Constructor Detail

RenderContextback to summary
public RenderContext(TextureBinder textures)

Method Detail

beginback to summary
public void begin()

Sets up the render context, must be matched with a call to end().

endback to summary
public void end()

Resets all changed OpenGL states to their defaults.

setBlendingback to summary
public void setBlending(final boolean enabled, final int sFactor, final int dFactor)
setBlendingback to summary
public void setBlending(final boolean enabled, final int sRgbFactor, final int dRgbFactor, final int sAlphaFactor, final int dAlphaFactor)
setCullFaceback to summary
public void setCullFace(final int face)
setDepthMaskback to summary
public void setDepthMask(final boolean depthMask)
setDepthTestback to summary
public void setDepthTest(final int depthFunction)
setDepthTestback to summary
public void setDepthTest(final int depthFunction, final float depthRangeNear, final float depthRangeFar)