Module gl1

Class OpenGLState

java.lang.Object
de.grogra.glsl.OpenGLState

public class OpenGLState extends Object
OpenGLState stores all relevant information about the used OpenGL Context. This includes active shaders, FBOs and the state of tests like the alpha test, the z-test. It also stores the state of culling and blending. This is done to prevent unnecessary state changes. This class also gives access to the used FBOs through an instance of the GLSLFBOManager class. It stores all data shared by the different classes of OpenGL (Proteus).
Author:
Konni Hartmann
  • Field Details

  • Constructor Details

    • OpenGLState

      public OpenGLState()
  • Method Details

    • getShapeManager

      public RenderableCollection getShapeManager()
    • presentDebugScreen

      public void presentDebugScreen(GLSLDisplay disp)
    • initSize

      public void initSize(int width, int height)
    • initLineCache

      public void initLineCache(GLDisplay disp)
    • info

      public void info(String txt)
    • warning

      public void warning(String txt)
    • setGL

      public void setGL(javax.media.opengl.GL glcontext)
    • getGL

      public javax.media.opengl.GL getGL()
    • getActiveShader

      public int getActiveShader()
    • setActiveProgram

      public void setActiveProgram(int program)
    • enable

      public void enable(char state)
    • disable

      public void disable(char state)
    • getState

      public boolean getState(char state)
    • setState

      public void setState(char state)
      Set the GL-Statemachine to the state given.
      Parameters:
      state - The State to be set. Each Bit corresponds to a certain Parameter.
    • setMatrixMode

      public void setMatrixMode(int matrixMode)
    • setDepthMask

      public void setDepthMask(boolean maskEnable)
    • setFBO

      public void setFBO(int fboNo)
    • setFaceCullingMode

      public void setFaceCullingMode(int faceCulling)
    • getFaceCullingMode

      public int getFaceCullingMode()
    • toGLMatrix4

      public double[] toGLMatrix4(Matrix4d m)
      Parameters:
      m -
      Returns:
      a one dimensional array containing the data of m ordered such that it may be used in OpenGL-Methods.
    • toGLMatrix3f

      public float[] toGLMatrix3f(Matrix3f mat)
      Parameters:
      mat -
      Returns:
    • loadMatrixd

      public void loadMatrixd(Matrix4d m)
    • cleanUp

      public void cleanUp(boolean javaonly)
    • setupBGShader

      public void setupBGShader(Shader shader)
    • getBGShader

      public Shader getBGShader()
    • setupBGPowerDensity

      public void setupBGPowerDensity(float powerDensity)
    • getBgPowerDensity

      public float getBgPowerDensity()
    • switchFloatRT

      public void switchFloatRT()
    • getFloatRT

      public int getFloatRT()
    • getFloatRTLast

      public int getFloatRTLast()
    • setShaderConfSwitch

      public void setShaderConfSwitch(int shaderConfSwitch)
    • testFBO

      public void testFBO()
    • testGLError

      public boolean testGLError()
    • testGLError

      public boolean testGLError(String prefix)
    • startClock

      public void startClock()
    • printClock

      public long printClock(String pre)
    • popClock

      public long popClock()
    • getGraphStamp

      public int getGraphStamp()
    • hasGraphChanged

      public boolean hasGraphChanged()
    • isAssumeTranspMaterials

      public boolean isAssumeTranspMaterials()
    • setAssumeTranspMaterials

      public void setAssumeTranspMaterials(boolean assumeTranspMaterials)
    • updateTransformations

      public void updateTransformations(GLSLDisplay disp)
    • getWorldToView

      public Matrix4d getWorldToView()
    • getInvWorldToView

      public Matrix4d getInvWorldToView()
    • getViewToClip

      public Matrix4d getViewToClip()
    • getInvViewToClip

      public Matrix4d getInvViewToClip()
    • printGPUMemoryUsage

      public void printGPUMemoryUsage(GLSLDisplay disp)
    • invalidateCache

      public void invalidateCache()
    • getDeferredShadingFBO

      public FrameBufferObject getDeferredShadingFBO()
      Returns:
      the deferredShadingFBO
    • getHDRFBO

      public FrameBufferObject getHDRFBO()
      Returns:
      the HDRFBO
    • getAlphaFBO

      public FrameBufferObject getAlphaFBO()
      Returns:
      the alphaFBO
    • getShadowFBO

      public FrameBufferObject getShadowFBO()
      Returns:
      the shadowFBO
    • getDualDepthFBO

      public FrameBufferObject getDualDepthFBO()
      Returns:
      the dualDepthFBO
    • getCubeFBO

      public FrameBufferObject getCubeFBO()
      Returns:
      the cubeFBO
    • getDepthRB

      public RenderBuffer getDepthRB()
      Returns:
      the depthRB
    • getPeelingFarDepthTRT

      public TextureRenderTarget getPeelingFarDepthTRT()
      Returns:
      the peelingFarDepthTRT
    • getPeelingRB

      public RenderBuffer getPeelingRB()
      Returns:
      the peelingRB
    • getPeelingNearDepthTRT

      public TextureRenderTarget getPeelingNearDepthTRT()
      Returns:
      the peelingNearDepthTRT
    • setDeferredShadingDepthTRT

      public void setDeferredShadingDepthTRT(TextureRenderTarget dsDTRT)
    • getDeferredShadingDepthTRT

      public TextureRenderTarget getDeferredShadingDepthTRT()
    • getFboManager

      public GLSLFBOManager getFboManager()
      Returns:
      the fboManager
    • setPoint

      public void setPoint(Vector3f v, int i)
    • printPoints

      public void printPoints()