Class CompiledShader

java.lang.Object
cz.fidentis.analyst.glsl.code.impl.CompiledShader

public class CompiledShader extends Object
A proxy object storing the information about a shader compiled on GPU.
  • Constructor Details

    • CompiledShader

      public CompiledShader(com.jogamp.opengl.GLContext glContext, GlslShaderDef shaderDef) throws com.jogamp.opengl.GLException
      Constructor that compiles the shader on GPU.
      Parameters:
      glContext - OpenGL context. Must not be null. Must be at least GL2.
      shaderDef - The definition of the shader to be compiled
      Throws:
      com.jogamp.opengl.GLException - if the GLSL source file reading or compilation fails
  • Method Details

    • release

      public void release()
      Ask GPU to release the shader from its memory. Shaders are removed only after they are not attached to any GLSL program anymore.
    • getId

      public int getId()
      Returns the ID of the shader in the OpenGL context
      Returns:
      shader's ID
    • getShaderDef

      public GlslShaderDef getShaderDef()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object