Class Shader

java.lang.Object
org.xjge.graphics.Shader

public final class Shader
extends java.lang.Object
Encapsulates an OpenGL shader object. These objects contain the compiled results of a .glsl source file and provide it as a single stage of a much larger GLProgram.
Since:
2.0.0
  • Constructor Summary

    Constructors
    Constructor Description
    Shader​(java.lang.String filename, int stage)
    Parses a .glsl source file then utilizes the stage specified to produce a new OpenGL shader object.
  • Method Summary

    Methods inherited from class java.lang.Object

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

    • Shader

      public Shader​(java.lang.String filename, int stage)
      Parses a .glsl source file then utilizes the stage specified to produce a new OpenGL shader object.
      Parameters:
      filename - the name of the .glsl file to parse. Expects the file extension to be included.
      stage - the stage of the shader process this object will describe. One of:
      GL_VERTEX_SHADER GL_FRAGMENT_SHADER GL_GEOMETRY_SHADER
      GL_TESS_CONTROL_SHADER GL_TESS_EVALUATION_SHADER GL_COMPUTE_SHADER