Class OGL41Graphics

All Implemented Interfaces:
OGLVersioned
Direct Known Subclasses:
OGL42Graphics

public class OGL41Graphics extends OGL40Graphics
OpenGL 4.1 Graphics Implementation.
Author:
Matthew Tropiano
  • Constructor Details

  • Method Details

    • getVersion

      public OGLVersion getVersion()
      Specified by:
      getVersion in interface OGLVersioned
      Overrides:
      getVersion in class OGL40Graphics
      Returns:
      the version that this object or value is available for (and higher).
    • createInfo

      protected OGLGraphics.Info createInfo()
      Description copied from class: OGLGraphics
      Called once in order to fetch context info.
      Overrides:
      createInfo in class OGL40Graphics
      Returns:
      the info object.
    • endFrame

      protected void endFrame()
      Description copied from class: OGLGraphics
      Called on frame end - mostly does cleanup of objects that were abandoned in OpenGL.
      Overrides:
      endFrame in class OGL33Graphics
    • setViewportIndex

      public void setViewportIndex(int index, int x, int y, int width, int height)
      Sets a viewport at a specific index.
      Parameters:
      index - the index to set.
      x - x-coordinate origin of the screen.
      y - y-coordinate origin of the screen.
      width - the width of the viewport in pixels.
      height - the height of the viewport in pixels.
      See Also:
    • setProgramBinaryRetriveableHint

      public void setProgramBinaryRetriveableHint(OGLProgram program, boolean enabled)
      Sets a hint on a program to tell OpenGL that you are going to retrieve a binary representation from it. You should set this flag before linking a program.
      Parameters:
      program - the program to set the hint on.
      enabled - true to enable, false to disable.
    • setProgramSeparable

      public void setProgramSeparable(OGLProgram program, boolean enabled)
      Sets a flag on a program to tell OpenGL that you are planning to add this to a pipeline later. You should set this flag before linking a program.
      Parameters:
      program - the program to set the hint on.
      enabled - true to enable, false to disable.
    • getProgramBinary

      public OGL41Graphics.ProgramBinary getProgramBinary(OGLProgram program)
      Retrieves the binary representation of a compiled and linked program.
      Parameters:
      program - the program to get the binary data from.
      Returns:
      a ProgramBinary object that contains the program binary representation.
      Throws:
      GraphicsException - if the program is not linked.
      See Also:
    • setProgramBinary

      public void setProgramBinary(OGLProgram program, OGL41Graphics.ProgramBinary programBinary)
      Creates a program from a binary representation.
      Parameters:
      program - the program to update.
      programBinary - the binary representation to use.
      Throws:
      GraphicsException - if the program could not be uploaded.
      See Also:
    • createProgramPipeline

      public OGLProgramPipeline createProgramPipeline()
      Creates a new Program Pipeline object.
      Returns:
      a new program pipeline object.
    • destroyProgramPipeline

      public void destroyProgramPipeline(OGLProgramPipeline pipeline)
      Destroys a program pipeline.
      Parameters:
      pipeline - the pipeline to destroy.
    • getProgramPipelineInfoLog

      public String getProgramPipelineInfoLog(OGLProgramPipeline pipeline)
      Fetches a program pipeline's info log aas a string.
      Parameters:
      pipeline - the pipeline to query.
      Returns:
      the pipeline's info log as a string.
    • validateProgramPipeline

      public void validateProgramPipeline(OGLProgramPipeline pipeline)
      Checks the validity of a program pipeline's executables against this OpenGL context.
      Parameters:
      pipeline - the pipeline to check.
      Throws:
      GraphicsException - if the pipeline is invalid.