Class RenderContext


  • public class RenderContext
    extends java.lang.Object
    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.
    • 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 to end().
      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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 to end().
      • 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)