Class GlStateBackup

java.lang.Object
net.neoforged.neoforge.client.GlStateBackup

public final class GlStateBackup extends Object
Backup of the OpenGL render state, for use in GUI rendering that needs to be able to go back to the previous render state after calling third-party renderers which may apply arbitrary modifications to the render state.

Create a backup before changing the global render state with RenderSystem.backupGlState(GlStateBackup), and apply the backup with RenderSystem.restoreGlState(GlStateBackup).

  • Field Details

    • blendEnabled

      public boolean blendEnabled
    • blendSrcRgb

      public int blendSrcRgb
    • blendDestRgb

      public int blendDestRgb
    • blendSrcAlpha

      public int blendSrcAlpha
    • blendDestAlpha

      public int blendDestAlpha
    • depthEnabled

      public boolean depthEnabled
    • depthMask

      public boolean depthMask
    • depthFunc

      public int depthFunc
    • cullEnabled

      public boolean cullEnabled
    • polyOffsetFillEnabled

      public boolean polyOffsetFillEnabled
    • polyOffsetLineEnabled

      public boolean polyOffsetLineEnabled
    • polyOffsetFactor

      public float polyOffsetFactor
    • polyOffsetUnits

      public float polyOffsetUnits
    • colorLogicEnabled

      public boolean colorLogicEnabled
    • colorLogicOp

      public int colorLogicOp
    • stencilFuncFunc

      public int stencilFuncFunc
    • stencilFuncRef

      public int stencilFuncRef
    • stencilFuncMask

      public int stencilFuncMask
    • stencilMask

      public int stencilMask
    • stencilFail

      public int stencilFail
    • stencilZFail

      public int stencilZFail
    • stencilZPass

      public int stencilZPass
    • scissorEnabled

      public boolean scissorEnabled
    • colorMaskRed

      public boolean colorMaskRed
    • colorMaskGreen

      public boolean colorMaskGreen
    • colorMaskBlue

      public boolean colorMaskBlue
    • colorMaskAlpha

      public boolean colorMaskAlpha
  • Constructor Details

    • GlStateBackup

      public GlStateBackup()