Class DirectGlStateCache

java.lang.Object
lol.trq.helios.state.DirectGlStateCache
All Implemented Interfaces:
GlStateCache

public final class DirectGlStateCache extends Object implements GlStateCache
A GlStateCache for hosts that cache nothing: every call goes straight to the backend.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the cache.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activeTexture(int unit)
    Selects the active texture unit.
    void
    bindTexture(int texture)
    Binds a 2D texture on the active unit.
    void
    blend(boolean on)
    Enables or disables blending.
    void
    blendFunc(int srcRgb, int dstRgb, int srcAlpha, int dstAlpha)
    Sets the separate blend factors.
    void
    colorMask(boolean r, boolean g, boolean b, boolean a)
    Sets which colour channels are written.
    void
    cull(boolean on)
    Enables or disables face culling.
    void
    depthMask(boolean write)
    Sets the depth write mask.
    void
    depthTest(boolean on)
    Enables or disables the depth test.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DirectGlStateCache

      public DirectGlStateCache(GlBackend gl)
      Creates the cache.
      Parameters:
      gl - the backend
  • Method Details

    • blend

      public void blend(boolean on)
      Description copied from interface: GlStateCache
      Enables or disables blending.
      Specified by:
      blend in interface GlStateCache
      Parameters:
      on - whether blending is on
    • blendFunc

      public void blendFunc(int srcRgb, int dstRgb, int srcAlpha, int dstAlpha)
      Description copied from interface: GlStateCache
      Sets the separate blend factors.
      Specified by:
      blendFunc in interface GlStateCache
      Parameters:
      srcRgb - source RGB factor
      dstRgb - destination RGB factor
      srcAlpha - source alpha factor
      dstAlpha - destination alpha factor
    • depthTest

      public void depthTest(boolean on)
      Description copied from interface: GlStateCache
      Enables or disables the depth test.
      Specified by:
      depthTest in interface GlStateCache
      Parameters:
      on - whether the depth test is on
    • depthMask

      public void depthMask(boolean write)
      Description copied from interface: GlStateCache
      Sets the depth write mask.
      Specified by:
      depthMask in interface GlStateCache
      Parameters:
      write - whether depth writes are on
    • cull

      public void cull(boolean on)
      Description copied from interface: GlStateCache
      Enables or disables face culling.
      Specified by:
      cull in interface GlStateCache
      Parameters:
      on - whether culling is on
    • activeTexture

      public void activeTexture(int unit)
      Description copied from interface: GlStateCache
      Selects the active texture unit.
      Specified by:
      activeTexture in interface GlStateCache
      Parameters:
      unit - GL_TEXTURE0 plus the unit number
    • bindTexture

      public void bindTexture(int texture)
      Description copied from interface: GlStateCache
      Binds a 2D texture on the active unit.
      Specified by:
      bindTexture in interface GlStateCache
      Parameters:
      texture - the texture
    • colorMask

      public void colorMask(boolean r, boolean g, boolean b, boolean a)
      Description copied from interface: GlStateCache
      Sets which colour channels are written.
      Specified by:
      colorMask in interface GlStateCache
      Parameters:
      r - red
      g - green
      b - blue
      a - alpha