Class RenderContext
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.utils.RenderContext
-
public class RenderContext extends java.lang.Object
Manages OpenGL state and tries to reduce state changes. Uses aTextureBinder
to reduce texture binds as well. Callbegin()
to setup the context, callend()
to undo all state changes. Use the setters to change state, usetextureBinder
to bind textures.
-
-
Field Summary
Fields Modifier and Type Field Description TextureBinder
textureBinder
used to bind textures
-
Constructor Summary
Constructors Constructor Description RenderContext(TextureBinder textures)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
begin()
Sets up the render context, must be matched with a call toend()
.void
end()
Resets all changed OpenGL states to their defaults.void
setBlending(boolean enabled, int sFactor, int dFactor)
void
setCullFace(int face)
void
setDepthMask(boolean depthMask)
void
setDepthTest(int depthFunction)
void
setDepthTest(int depthFunction, float depthRangeNear, float depthRangeFar)
-
-
-
Field Detail
-
textureBinder
public final TextureBinder textureBinder
used to bind textures
-
-
Constructor Detail
-
RenderContext
public RenderContext(TextureBinder textures)
-
-
Method Detail
-
begin
public void begin()
Sets up the render context, must be matched with a call toend()
.
-
end
public void end()
Resets all changed OpenGL states to their defaults.
-
setDepthMask
public void setDepthMask(boolean depthMask)
-
setDepthTest
public void setDepthTest(int depthFunction)
-
setDepthTest
public void setDepthTest(int depthFunction, float depthRangeNear, float depthRangeFar)
-
setBlending
public void setBlending(boolean enabled, int sFactor, int dFactor)
-
setCullFace
public void setCullFace(int face)
-
-