Class ShaderProgram

  • All Implemented Interfaces:
    RenderResource
    Direct Known Subclasses:
    AtmosphereProgram, BasicShaderProgram, SightlineProgram, SurfaceTextureProgram

    public class ShaderProgram
    extends java.lang.Object
    implements RenderResource
    Represents an OpenGL shading language (GLSL) shader program and provides methods for identifying and accessing shader variables. Shader programs are configured by calling setProgramSources to specify the the GLSL vertex shader and fragment shader source code, then made current by calling useProgram.
    • Constructor Detail

      • ShaderProgram

        public ShaderProgram()
    • Method Detail

      • getProgramSources

        public java.lang.String[] getProgramSources()
      • setProgramSources

        public void setProgramSources​(java.lang.String... programSources)
      • getAttribBindings

        public java.lang.String[] getAttribBindings()
      • setAttribBindings

        public void setAttribBindings​(java.lang.String... attribBindings)
      • getProgramLength

        public int getProgramLength()
      • release

        public void release​(DrawContext dc)
        Description copied from interface: RenderResource
        Frees any resources associated with this instance. After this method returns the rendering resource is invalid, and any associated GL object is deleted.
        Specified by:
        release in interface RenderResource
        Parameters:
        dc - the current draw context
      • useProgram

        public boolean useProgram​(DrawContext dc)