Class OGL11Graphics

java.lang.Object
com.blackrook.gloop.opengl.OGLGraphics
com.blackrook.gloop.opengl.gl1.OGL11Graphics
All Implemented Interfaces:
OGLVersioned
Direct Known Subclasses:
OGL12Graphics

public class OGL11Graphics extends OGLGraphics
OpenGL 1.1 Graphics Implementation.
Author:
Matthew Tropiano
  • Constructor Details

  • Method Details

    • getVersion

      public OGLVersion getVersion()
      Returns:
      the version that this object or value is available for (and higher).
    • getCurrentActiveTextureState

      protected OGLTexture getCurrentActiveTextureState(int targetId)
      Gets the current texture state. Uses the current texture unit.
      Parameters:
      targetId - the texture target id.
      Returns:
      the current texture, or null if no current.
      See Also:
    • setCurrentActiveTextureState

      protected void setCurrentActiveTextureState(int targetId, OGLTexture texture)
      Sets the current texture state. Uses the current texture unit.
      Parameters:
      targetId - the texture target id.
      texture - the texture to set.
      See Also:
    • getCurrentActiveTextureUnitState

      protected int getCurrentActiveTextureUnitState()
      Returns:
      the current "active" texture unit.
    • setCurrentActiveTextureUnitState

      protected void setCurrentActiveTextureUnitState(int unit)
      Sets the current texture unit state.
      Parameters:
      unit - the current "active" texture unit to set.
    • getCurrentMatrixId

      protected Integer getCurrentMatrixId()
      Returns:
      the current matrix mode index.
    • setCurrentMatrixId

      protected void setCurrentMatrixId(Integer currentMatrixId)
      Sets the current matrix id.
      Parameters:
      currentMatrixId - the new current matrix id.
    • getCurrentMatrixStack

      protected MatrixStack getCurrentMatrixStack()
      Returns:
      the current matrix stack, or null if no current matrix.
    • getCurrentMatrixStack

      protected MatrixStack getCurrentMatrixStack(int id)
      Parameters:
      id - the matrix id.
      Returns:
      the current matrix stack, or null if no current matrix.
    • resolveCurrentMatrixStack

      protected MatrixStack resolveCurrentMatrixStack()
      Returns:
      the current matrix stack.
      Throws:
      GraphicsException - if no current matrix is set.
    • createInfo

      protected OGLGraphics.Info createInfo()
      Description copied from class: OGLGraphics
      Called once in order to fetch context info.
      Specified by:
      createInfo in class OGLGraphics
      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.
      Specified by:
      endFrame in class OGLGraphics
    • clear

      public void clear(boolean clearColorBuffer, boolean clearDepthBuffer, boolean clearAccumulationBuffer, boolean clearStencilBuffer)
      Clears a bunch of the current framebuffers.

      This is the non-core clear function, since it includes the accumulation buffer, optionally.

      Parameters:
      clearColorBuffer - if true, clear the color buffer.
      clearDepthBuffer - if true, clear the depth buffer.
      clearAccumulationBuffer - if true, clear the accumulation buffer.
      clearStencilBuffer - if true, clear the stencil buffer.
    • setColor

      public void setColor(Color c)
      Sets the current color used for drawing polygons and other geometry.
      Parameters:
      c - the color to use.
    • setColor

      public void setColor(float red, float green, float blue, float alpha)
      Sets the current color used for drawing polygons and other geometry.
      Parameters:
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
    • setColorARGB

      public void setColorARGB(int argb)
      Sets the current color used for drawing polygons and other geometry using an ARGB integer.
      Parameters:
      argb - the 32-bit color as an integer.
    • setLightingEnabled

      public void setLightingEnabled(boolean enable)
      Sets if lighting is enabled.
      Parameters:
      enable - true to enable, false to disable.
    • setLightShadeType

      public void setLightShadeType(LightShadeType shade)
      Sets the light shading type.
      Parameters:
      shade - the shading type.
    • checkLightId

      protected void checkLightId(int sourceId)
      Verifies that the light source id is valid.
      Parameters:
      sourceId - the light source id.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightEnabled

      public void setLightEnabled(int sourceId, boolean enable)
      Sets if certain lights are enabled.
      Parameters:
      sourceId - the light source id.
      enable - true to enable, false to disable.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLight

      public void setLight(int sourceId, OGLLight light)
      Sets the current light used for illuminating polygons and other geometry. This light will set all properties.
      Parameters:
      sourceId - the light source id. this cannot exceed the maximum number of lights that OpenGL can handle.
      light - the Light to use.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightAttenuation

      public void setLightAttenuation(int sourceId, float constant, float linear, float quadratic)
      Sets the current light attenuation used for illuminating polygons and other geometry. This alters light intensity at varying distances from the light.
      Parameters:
      sourceId - the light source id. this cannot exceed the maximum number of lights that OpenGL can handle.
      constant - the constant coefficient.
      linear - the linear coefficient.
      quadratic - the quadratic coefficient.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightAmbientColor

      public void setLightAmbientColor(int sourceId, Color color)
      Sets the color for a ambient component for a light.
      Parameters:
      sourceId - the light source id.
      color - the color to use.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightAmbientColor

      public void setLightAmbientColor(int sourceId, int argbColor)
      Sets the color for a ambient component for a light.
      Parameters:
      sourceId - the light source id.
      argbColor - the ARGB color to set.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightAmbientColor

      public void setLightAmbientColor(int sourceId, float red, float green, float blue, float alpha)
      Sets the color for a ambient component for a light.
      Parameters:
      sourceId - the light source id.
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightDiffuseColor

      public void setLightDiffuseColor(int sourceId, Color color)
      Sets the color for a diffuse component for a light.
      Parameters:
      sourceId - the light source id.
      color - the color to use.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightDiffuseColor

      public void setLightDiffuseColor(int sourceId, int argbColor)
      Sets the color for a diffuse component for a light.
      Parameters:
      sourceId - the light source id.
      argbColor - the ARGB color to set.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightDiffuseColor

      public void setLightDiffuseColor(int sourceId, float red, float green, float blue, float alpha)
      Sets the color for a diffuse component for a light.
      Parameters:
      sourceId - the light source id.
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightSpecularColor

      public void setLightSpecularColor(int sourceId, Color color)
      Sets the color for a specular component for a light.
      Parameters:
      sourceId - the light source id.
      color - the color to use.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightSpecularColor

      public void setLightSpecularColor(int sourceId, int argbColor)
      Sets the color for a specular component for a light.
      Parameters:
      sourceId - the light source id.
      argbColor - the ARGB color to set.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightSpecularColor

      public void setLightSpecularColor(int sourceId, float red, float green, float blue, float alpha)
      Sets the color for a specular component for a light.
      Parameters:
      sourceId - the light source id.
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setLightPosition

      public void setLightPosition(int sourceId, float x, float y, float z, float w)
      Sets the position of a light source.
      Parameters:
      sourceId - the light source id.
      x - the x-axis position.
      y - the y-axis position.
      z - the z-axis position.
      w - if 0, the light is a directional one. If nonzero, positional.
      Throws:
      IllegalArgumentException - if the specified sourceId is not a valid one.
    • setMaterial

      public void setMaterial(OGLMaterial material)
      Sets the current material used for drawing polygons and other geometry. Depending on what colors are set on the Material object, not all of the material calls will be made. This applies the Material properties to both polygon sides, and will remain doing so until this is changed.
      Parameters:
      material - the material to use.
    • setMaterial

      public void setMaterial(FaceSide faceside, OGLMaterial material)
      Sets the current material used for drawing polygons and other geometry, and will remain doing so until this is changed. Depending on what colors are set on the Material object, not all of the material calls will be made.
      Parameters:
      faceside - the face side to apply these properties to.
      material - the material to use.
    • setMaterialAmbientColor

      public void setMaterialAmbientColor(FaceSide faceside, Color color)
      Sets the current material ambient color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      color - the color to use.
    • setMaterialAmbientColor

      public void setMaterialAmbientColor(FaceSide faceside, int argbColor)
      Sets the current material ambient color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      argbColor - the ARGB color to set.
    • setMaterialAmbientColor

      public void setMaterialAmbientColor(FaceSide faceside, float red, float green, float blue, float alpha)
      Sets the current material ambient color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
    • setMaterialDiffuseColor

      public void setMaterialDiffuseColor(FaceSide faceside, Color color)
      Sets the current material diffuse color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      color - the color to use.
    • setMaterialDiffuseColor

      public void setMaterialDiffuseColor(FaceSide faceside, int argbColor)
      Sets the current material diffuse color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      argbColor - the ARGB color to set.
    • setMaterialDiffuseColor

      public void setMaterialDiffuseColor(FaceSide faceside, float red, float green, float blue, float alpha)
      Sets the current material diffuse color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
    • setMaterialSpecularColor

      public void setMaterialSpecularColor(FaceSide faceside, Color color)
      Sets the current material specular color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      color - the color to use.
    • setMaterialSpecularColor

      public void setMaterialSpecularColor(FaceSide faceside, int argbColor)
      Sets the current material specular color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      argbColor - the ARGB color to set.
    • setMaterialSpecularColor

      public void setMaterialSpecularColor(FaceSide faceside, float red, float green, float blue, float alpha)
      Sets the current material specular color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
    • setMaterialEmissionColor

      public void setMaterialEmissionColor(FaceSide faceside, Color color)
      Sets the current material emission color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      color - the color to use.
    • setMaterialEmissionColor

      public void setMaterialEmissionColor(FaceSide faceside, int argbColor)
      Sets the current material emission color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      argbColor - the ARGB color to set.
    • setMaterialEmissionColor

      public void setMaterialEmissionColor(FaceSide faceside, float red, float green, float blue, float alpha)
      Sets the current material emission color used for drawing polygons and other geometry.
      Parameters:
      faceside - the face side to apply these properties to.
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
    • setMaterialShininessFactor

      public void setMaterialShininessFactor(FaceSide faceside, float f)
      Sets the current material shininess factor used for drawing polygons and other geometry. As this number gets higher,
      Parameters:
      faceside - the face side to apply these properties to.
      f - the factor.
    • setFogEnabled

      public void setFogEnabled(boolean enabled)
      Sets if fog rendering is enabled or disabled.
      Parameters:
      enabled - true to enable, false to disable.
    • setFogLinear

      public void setFogLinear(Color color, float start, float end)
      Sets most fog attributes at once for linear fog.
      Parameters:
      color - the color of the fog.
      start - the unit of space for the fog start (before that is no fog).
      end - the unit of space for the fog end (after that is solid color).
      See Also:
    • setFogExponent

      public void setFogExponent(Color color, float density)
      Sets most fog attributes at once for exponent fog.
      Parameters:
      color - the color of the fog.
      density - the density factor to use.
      See Also:
    • setFogExponentSquared

      public void setFogExponentSquared(Color color, float density)
      Sets most fog attributes at once for exponent squared fog.
      Parameters:
      color - the color of the fog.
      density - the density factor to use.
      See Also:
    • setFogColor

      public void setFogColor(Color color)
      Sets the color of the fog.
      Parameters:
      color - the color of the fog.
    • setFogColor

      public void setFogColor(int argb)
      Sets the current color used for fog as an ARGB integer.
      Parameters:
      argb - the 32-bit color as an integer.
    • setFogColor

      public void setFogColor(float red, float green, float blue, float alpha)
      Sets the color of the fog.
      Parameters:
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
    • setFogFormula

      public void setFogFormula(FogFormulaType formula)
      Sets the distance calculation formula for calculating fog cover.
      Parameters:
      formula - the formula to use.
    • setFogDensity

      public void setFogDensity(float density)
      Sets the density factor for calculating fog. Only works for the exponential formulas.
      Parameters:
      density - the density factor to use.
    • setFogStart

      public void setFogStart(float start)
      Sets the starting point for calculating fog. The value passed in is from the eye.
      Parameters:
      start - the unit of space for the fog start (before that is no fog).
    • setFogEnd

      public void setFogEnd(float end)
      Sets the starting point for calculating fog. The value passed in is from the eye.
      Parameters:
      end - the unit of space for the fog end (after that is solid color).
    • setTextureEnabled

      public void setTextureEnabled(TextureTargetType target, boolean enabled)
      Sets if a texture target is enabled for rendering or not.
      Parameters:
      target - the texture target.
      enabled - true to enable, false to disable.
    • setTextureEnvironment

      public void setTextureEnvironment(TextureMode mode)
      Sets the texture environment mode to use for texel fragment coloring. This is usually REPLACE, by default. Only viable in the fixed pipeline.
      Parameters:
      mode - the texture mode.
    • setTexGenSEnabled

      public void setTexGenSEnabled(boolean enabled)
      Sets if texture coordinates are to be automatically generated for the S coordinate axis (usually width).
      Parameters:
      enabled - true to enable, false to disable.
    • setTexGenTEnabled

      public void setTexGenTEnabled(boolean enabled)
      Sets if texture coordinates are to be automatically generated for the T coordinate axis (usually height).
      Parameters:
      enabled - true to enable, false to disable.
    • setTexGenREnabled

      public void setTexGenREnabled(boolean enabled)
      Sets if texture coordinates are to be automatically generated for the R coordinate axis (usually depth).
      Parameters:
      enabled - true to enable, false to disable.
    • setTexGenQEnabled

      public void setTexGenQEnabled(boolean enabled)
      Sets if texture coordinates are to be automatically generated for the Q coordinate axis (I have no idea what the hell this could be).
      Parameters:
      enabled - true to enable, false to disable.
    • setTexGenMode

      public void setTexGenMode(TextureCoordType coord, TextureGenMode mode)
      Sets how texture coordinates are to be automatically generated.
      Parameters:
      coord - the texture coordinate to set the mode for.
      mode - the generation function.
    • setTexGenEyePlane

      public void setTexGenEyePlane(TextureCoordType coord, float a, float b, float c, float d)
      Sets the eye plane equation for generating coordinates using the eye method.
      Parameters:
      coord - the texture coordinate to set the mode for.
      a - the plane A coordinate coefficient.
      b - the plane B coordinate coefficient.
      c - the plane C coordinate coefficient.
      d - the plane D coordinate coefficient.
    • setTexGenObjectPlane

      public void setTexGenObjectPlane(TextureCoordType coord, float a, float b, float c, float d)
      Sets the object plane equation for generating coordinates using the object method.
      Parameters:
      coord - the texture coordinate to set the mode for.
      a - the plane A coordinate coefficient.
      b - the plane B coordinate coefficient.
      c - the plane C coordinate coefficient.
      d - the plane D coordinate coefficient.
    • setAutoNormalGen

      public void setAutoNormalGen(boolean enabled)
      Sets if normal vectors are generated automatically when geometry is submitted to the OpenGL geometry pipeline.
      Parameters:
      enabled - true to enable, false to disable.
    • attribPush

      public void attribPush(AttribType... attribs)
      Pushes an array of attributes onto the attribute stack.
      Parameters:
      attribs - the list of attributes to preserve.
    • attribPop

      public void attribPop()
      Restores attributes from the attribute stack.
    • clientAttribPush

      public void clientAttribPush(ClientAttribType... attribs)
      Pushes a series of attributes onto the client attribute stack.
      Parameters:
      attribs - the list of attributes to preserve.
    • clientAttribPop

      public void clientAttribPop()
      Restores attributes from the client attribute stack.
    • setClearAccum

      public void setClearAccum(float clearRed, float clearGreen, float clearBlue, float clearAlpha)
      Sets the clear color for the accumulation buffer. The accumulation buffer is filled with this color upon clear.
      Parameters:
      clearRed - the red component of the color to use (0 to 1).
      clearGreen - the green component of the color to use (0 to 1).
      clearBlue - the blue component of the color to use (0 to 1).
      clearAlpha - the alpha component of the color to use (0 to 1).
    • accumulate

      public void accumulate(AccumOperation operation, float value)
      Performs an accumulation buffer operation. What happens with accum buffer contents differs based on the current color buffers for reading and writing, and the desired operation.
      Parameters:
      operation - the accum buffer operation.
      value - the value scalar for the operation.
      See Also:
    • setRasterPosition

      public void setRasterPosition(int x, int y, float z)
      Sets the next raster position for drawing bitmaps. Remember, (0,0) is the lower left edge of the window.
      Parameters:
      x - the screen x-coordinate.
      y - the screen y-coordinate.
      z - the screen z-coordinate.
    • drawBitmap

      public void drawBitmap(OGLBitmap b, float offsetX, float offsetY, float incX, float incY)
      Draws a Bitmap at the current raster position and increments the raster position.
      Parameters:
      b - the Bitmap to draw ((0,0) is the lower-left).
      offsetX - the offset from the current raster position, x-coordinate.
      offsetY - the offset from the current raster position, y-coordinate.
      incX - what to increment the raster position x-coordinate by after the draw.
      incY - what to increment the raster position y-coordinate by after the draw.
    • setVertexArrayEnabled

      public void setVertexArrayEnabled(boolean enable)
      Enables or disables the processing of bound vertex arrays and/or buffers.
      Parameters:
      enable - true to enable, false to disable.
    • setVertexArrayPointer

      public void setVertexArrayPointer(DataType dataType, int width, int stride, int offset)
      Sets what positions in the current BufferTargetType.GEOMETRY-bound buffer or array are used to draw polygonal information: This sets the attribute pointer for vertices.
      Parameters:
      dataType - the data type contained in the buffer that will be read (calculates actual sizes of data).
      width - the width of a full set of coordinates (3-dimensional vertices = 3).
      stride - the distance (in elements) between each vertex.
      offset - the offset in each stride where each vertex starts.
      See Also:
    • setTextureCoordinateArrayEnabled

      public void setTextureCoordinateArrayEnabled(boolean enable)
      Enables or disables the processing of bound texture coordinate arrays.
      Parameters:
      enable - true to enable, false to disable.
    • setTextureCoordinateArrayPointer

      public void setTextureCoordinateArrayPointer(DataType dataType, int width, int stride, int offset)
      Sets what positions in the current BufferTargetType.GEOMETRY-bound buffer or array are used to draw polygonal information: This sets the attribute pointer for texture coordinates.
      Parameters:
      dataType - the data type contained in the buffer that will be read (calculates actual sizes of data).
      width - the width of a full set of coordinates (2-dimensional coords = 2).
      stride - the distance (in elements) between each coordinate group.
      offset - the offset in each stride where each coordinate starts.
      See Also:
    • setColorArrayEnabled

      public void setColorArrayEnabled(boolean enable)
      Enables or disables the processing of bound vertex color arrays.
      Parameters:
      enable - true to enable, false to disable.
    • setColorArrayPointer

      public void setColorArrayPointer(DataType dataType, int width, int stride, int offset)
      Sets what positions in the current BufferTargetType.GEOMETRY-bound buffer or array are used to draw polygonal information: This sets the attribute pointer for colors.
      Parameters:
      dataType - the data type contained in the buffer that will be read (calculates actual sizes of data).
      width - the width of a full set of color components (4-component color = 4).
      stride - the distance (in elements) between each color.
      offset - the offset in each stride where each color starts.
      See Also:
    • setNormalArrayEnabled

      public void setNormalArrayEnabled(boolean enable)
      Enables or disables the processing of bound surface normal arrays.
      Parameters:
      enable - true to enable, false to disable.
    • setNormalArrayPointer

      public void setNormalArrayPointer(DataType dataType, int stride, int offset)
      Sets what positions in the current BufferTargetType.GEOMETRY-bound buffer or array are used to draw polygonal information: This sets the attribute pointer for normal vectors. Always assumes 3-dimensional vectors.
      Parameters:
      dataType - the data type contained in the buffer that will be read (calculates actual sizes of data).
      stride - the distance (in elements) between each normal.
      offset - the offset in each stride where each normal starts.
      See Also:
    • matrixMode

      public void matrixMode(MatrixMode mode)
      Sets the current matrix for matrix operations.
      Parameters:
      mode - the matrix mode to set.
      Throws:
      UnsupportedOperationException - if matrix modes are unavailable in this version (core implementation).
      NullPointerException - if the mode is null.
    • matrixReset

      public void matrixReset()
      Loads the identity matrix into the current selected matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

    • matrixPush

      public void matrixPush()
      Pushes a copy of the current matrix onto the current selected stack.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

    • matrixPop

      public void matrixPop()
      Pops the current matrix off of the current selected stack.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

    • matrixGet

      public void matrixGet(MatrixMode matrixType, float[] outArray)
      Reads a current matrix into an array.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      matrixType - the type of matrix to load.
      outArray - the output array. Must be length 16 or greater.
      Throws:
      ArrayIndexOutOfBoundsException - if the array length is less than 16.
      UnsupportedOperationException - if matrix modes are unavailable in this version (core implementation).
    • matrixGet

      public void matrixGet(MatrixMode matrixType, Matrix4F matrix)
      Reads a current matrix into a matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      matrixType - the type of matrix to load.
      matrix - the output matrix.
      Throws:
      UnsupportedOperationException - if matrix modes are unavailable in this version (core implementation).
    • matrixSet

      public void matrixSet(float[] matrixArray)
      Loads a matrix's contents from a column-major array into the current selected matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      matrixArray - the column-major cells of a matrix.
    • matrixSet

      public void matrixSet(Matrix4F matrix)
      Loads a matrix's contents into the current selected matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      matrix - the matrix to read from.
    • matrixMultiply

      public void matrixMultiply(float[] matrixArray)
      Multiplies a matrix into the current selected matrix from a column-major array into.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      matrixArray - the column-major cells of a matrix.
    • matrixMultiply

      public void matrixMultiply(Matrix4F matrix)
      Multiplies a matrix into the current selected matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      matrix - the matrix to read from.
    • matrixTranslate

      public void matrixTranslate(float x, float y, float z)
      Translates the current matrix by a set of units. This is applied via multiplication with the current matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      x - the x-axis translation.
      y - the y-axis translation.
      z - the z-axis translation.
    • matrixRotateX

      public void matrixRotateX(float degrees)
      Rotates the current matrix by an amount of DEGREES around the X-Axis. This is applied via multiplication with the current matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      degrees - the amount of degrees.
    • matrixRotateY

      public void matrixRotateY(float degrees)
      Rotates the current matrix by an amount of DEGREES around the Y-Axis. This is applied via multiplication with the current matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      degrees - the amount of degrees.
    • matrixRotateZ

      public void matrixRotateZ(float degrees)
      Rotates the current matrix by an amount of DEGREES around the Z-Axis. This is applied via multiplication with the current matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      degrees - the amount of degrees.
    • matrixScale

      public void matrixScale(float x, float y, float z)
      Scales the current matrix by a set of scalars that correspond to each axis. This is applied via multiplication with the current matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      x - the x-axis scalar.
      y - the y-axis scalar.
      z - the z-axis scalar.
    • matrixPerspective

      public void matrixPerspective(float fov, float aspect, float near, float far)
      Multiplies the current matrix by a symmetric perspective projection matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      fov - front of view angle in degrees.
      aspect - the aspect ratio, usually view width over view height.
      near - the near clipping plane on the Z-Axis.
      far - the far clipping plane on the Z-Axis.
      Throws:
      GraphicsException - if fov == 0 || aspect == 0 || near == far.
    • matrixFrustum

      public void matrixFrustum(float left, float right, float bottom, float top, float near, float far)
      Multiplies the current matrix by a frustum projection matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      left - the left clipping plane on the X-Axis.
      right - the right clipping plane on the X-Axis.
      bottom - the bottom clipping plane on the Y-Axis.
      top - the upper clipping plane on the Y-Axis.
      near - the near clipping plane on the Z-Axis.
      far - the far clipping plane on the Z-Axis.
      Throws:
      GraphicsException - if left == right || bottom == top || near == far.
    • matrixOrtho

      public void matrixOrtho(float left, float right, float bottom, float top, float near, float far)
      Multiplies the current matrix by an orthographic projection matrix.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      left - the left clipping plane on the X-Axis.
      right - the right clipping plane on the X-Axis.
      bottom - the bottom clipping plane on the Y-Axis.
      top - the upper clipping plane on the Y-Axis.
      near - the near clipping plane on the Z-Axis.
      far - the far clipping plane on the Z-Axis.
      Throws:
      GraphicsException - if left == right || bottom == top || near == far.
    • matrixAspectOrtho

      public void matrixAspectOrtho(float targetAspect, float left, float right, float bottom, float top, float near, float far)
      Multiplies the current matrix by an aspect-adjusted orthographic projection matrix using the canvas dimensions.

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      targetAspect - the target orthographic
      left - the left clipping plane on the X-Axis.
      right - the right clipping plane on the X-Axis.
      bottom - the bottom clipping plane on the Y-Axis.
      top - the upper clipping plane on the Y-Axis.
      near - the near clipping plane on the Z-Axis.
      far - the far clipping plane on the Z-Axis.
      Throws:
      GraphicsException - if left == right || bottom == top || near == far.
    • matrixLookAt

      public void matrixLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
      Multiplies a "look at" matrix to the current matrix. This sets up the matrix to look at a place in the world (if modelview).

      This is technically not available in Core OpenGL, but is instead implemented using MatrixStack for core implementations.

      Parameters:
      eyeX - the point to look at, X-coordinate.
      eyeY - the point to look at, Y-coordinate.
      eyeZ - the point to look at, Z-coordinate.
      centerX - the reference point to look from, X-coordinate.
      centerY - the reference point to look from, Y-coordinate.
      centerZ - the reference point to look from, Z-coordinate.
      upX - the up vector of the viewpoint, X-coordinate.
      upY - the up vector of the viewpoint, Y-coordinate.
      upZ - the up vector of the viewpoint, Z-coordinate.
    • flush

      public void flush()
      Tells the OpenGL implementation to finish all pending commands in finite time. This ensures that the next commands are executed immediately. Has little to no effect on a double-buffered setup. Not to be confused with finish().
      See Also:
    • finish

      public void finish()
      Tells the OpenGL implementation to finish all pending commands, and waits for it to do so. OpenGL commands are usually pipelined for performance reasons. This ensures that OpenGL finishes all pending commands so that what you expect in the target writable buffers is the last command executed, then resumes this thread.

      NOTE: This best called right before a screenshot is taken.

    • setHint

      public void setHint(HintType type, HintValue value)
      Sets an OpenGL hint.
      Parameters:
      type - the hint type to set.
      value - the value to set for the provided hint.
    • setFillMode

      public void setFillMode(FillMode mode)
      Set polygon fill mode.
      Parameters:
      mode - the fill mode.
    • setFrontFillMode

      public void setFrontFillMode(FillMode mode)
      Set front polygon fill mode.
      Parameters:
      mode - the fill mode.
    • setBackFillMode

      public void setBackFillMode(FillMode mode)
      Set back polygon fill mode.
      Parameters:
      mode - the fill mode.
    • setViewport

      public void setViewport(int x, int y, int width, int height)
      Sets the OpenGL viewport (Note: (0,0) is the lower-left corner). If any value is below zero, it is clamped to zero.
      Parameters:
      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.
    • setFaceFront

      public void setFaceFront(FaceSide.Direction faceFront)
      Sets face winding to determine the front face.
      Parameters:
      faceFront - the front side.
    • setClearColor

      public void setClearColor(float clearRed, float clearGreen, float clearBlue, float clearAlpha)
      Sets the clear color. The color buffer is filled with this color upon clear.
      Parameters:
      clearRed - the red component of the color to use (0 to 1).
      clearGreen - the green component of the color to use (0 to 1).
      clearBlue - the blue component of the color to use (0 to 1).
      clearAlpha - the alpha component of the color to use (0 to 1).
    • setClearDepth

      public void setClearDepth(double depthValue)
      Sets depth clear value. If the depth buffer gets cleared, this is the value that is written to all of the pixels in the buffer.
      Parameters:
      depthValue - the depth value to set on clear.
    • setClearStencil

      public void setClearStencil(int mask)
      Sets the stencil mask clear value.
      Parameters:
      mask - the mask bits.
    • clear

      public void clear(boolean clearColorBuffer, boolean clearDepthBuffer, boolean clearStencilBuffer)
      Clears a bunch of current framebuffers.
      Parameters:
      clearColorBuffer - if true, clear the color buffer.
      clearDepthBuffer - if true, clear the depth buffer.
      clearStencilBuffer - if true, clear the stencil buffer.
    • setColorMask

      public void setColorMask(boolean red, boolean green, boolean blue, boolean alpha)
      Sets if each color component gets written to the color buffer.
      Parameters:
      red - will the red component be written to the buffer?
      green - will the green component be written to the buffer?
      blue - will the blue component be written to the buffer?
      alpha - will the alpha component be written to the buffer?
    • setColorMask

      public void setColorMask(boolean enabled)
      Sets if all of the components of the color buffer get written to.
      Parameters:
      enabled - true to enable all components, false to disable.
    • setPointSize

      public void setPointSize(float size)
      Sets the reference unit size for the diameter of Point geometry.
      Parameters:
      size - the minimum size.
    • setPointSmoothingEnabled

      public void setPointSmoothingEnabled(boolean enabled)
      Enables/Disables smooth point geometry.
      Parameters:
      enabled - true to enable, false to disable.
    • setLineWidth

      public void setLineWidth(float width)
      Sets the width of line geometry.
      Parameters:
      width - the width of the line in pixels.
    • setLineSmoothingEnabled

      public void setLineSmoothingEnabled(boolean enabled)
      Enables/Disables line smoothing. "Line smoothing" is a fancy term for anti-aliasing.
      Parameters:
      enabled - true to enable, false to disable.
    • setFrameBufferRead

      public void setFrameBufferRead(FrameBufferType type)
      Sets the current buffer to read from for pixel read/copy operations. By default, this is the BACK buffer in double-buffered contexts.
      Parameters:
      type - the buffer to read from from now on.
      Throws:
      IllegalArgumentException - if type is NONE or FRONT_AND_BACK.
    • setFrameBufferWrite

      public void setFrameBufferWrite(FrameBufferType type)
      Sets the current buffer to write to for pixel drawing/rasterizing operations. By default, this is the BACK buffer in double-buffered contexts.
      Parameters:
      type - the buffer to write to from now on.
      Throws:
      IllegalArgumentException - if type is NONE or FRONT_AND_BACK.
    • readFrameBuffer

      public void readFrameBuffer(ByteBuffer imageData, ColorFormat colorFormat, int x, int y, int width, int height)
      Reads from the current-bound frame buffer into a target buffer.
      Parameters:
      imageData - the buffer to write the pixel data to (must be direct).
      colorFormat - the color format to write to the buffer.
      x - the starting screen offset, x-coordinate (0 is left).
      y - the starting screen offset, y-coordinate (0 is bottom).
      width - the capture width in pixels.
      height - the capture height in pixels.
      Throws:
      GraphicsException - if the buffer provided is not direct.
    • setPixelPackAlignment

      public void setPixelPackAlignment(int alignment)
      Sets the current pixel packing alignment value (GL-to-application). This is used for pulling pixel data from an OpenGL buffer into a format that the application can recognize/manipulate.
      Parameters:
      alignment - the alignment in bytes.
    • getPixelPackAlignment

      public int getPixelPackAlignment()
      Gets the current pixel packing alignment value (GL-to-application). This is used for pulling pixel data from an OpenGL buffer into a format that the application can recognize/manipulate.
      Returns:
      the packing alignment in bytes.
    • setPixelUnpackAlignment

      public void setPixelUnpackAlignment(int alignment)
      Sets the current pixel unpacking alignment value (application-to-GL). This is used for pulling pixel data from an OpenGL buffer into a format that the application can recognize/manipulate.
      Parameters:
      alignment - the alignment in bytes.
    • getPixelUnpackAlignment

      public int getPixelUnpackAlignment()
      Gets the current pixel unpacking alignment value (application-to-GL). This is used for pulling pixel data from an OpenGL buffer into a format that the application can recognize/manipulate.
      Returns:
      the unpacking alignment in bytes.
    • setDepthTestEnabled

      public void setDepthTestEnabled(boolean enabled)
      Sets if the depth test is enabled or not for incoming fragments.
      Parameters:
      enabled - true to enable, false to disable.
    • setDepthFunc

      public void setDepthFunc(LogicFunc func)
      Set depth comparison function.
      Parameters:
      func - the function to set.
    • setDepthMask

      public void setDepthMask(boolean enabled)
      Sets if the depth buffer is enabled for writing.
      Parameters:
      enabled - true to enable, false to disable.
    • setStencilMask

      public void setStencilMask(int mask)
      Sets the stencil mask.
      Parameters:
      mask - the mask bits.
    • setStencilTestEnabled

      public void setStencilTestEnabled(boolean enabled)
      Sets if the stencil test is enabled or not for incoming fragments.
      Parameters:
      enabled - true to enable, false to disable.
    • setStencilTestFunc

      public void setStencilTestFunc(LogicFunc func, int ref, int refmask)
      Sets the stencil function for the stencil test.
      Parameters:
      func - the comparison function to use.
      ref - the reference value.
      refmask - the stencil mask bits.
    • setStencilTestOperations

      public void setStencilTestOperations(StencilTestFunc stencilFail, StencilTestFunc stencilDepthFail, StencilTestFunc stencilDepthPass)
      Sets the functions for what to do for each incoming fragment.
      Parameters:
      stencilFail - the function to perform if the stencil test fails.
      stencilDepthFail - the function to perform if the stencil test passes, but the depth test fails (if enabled).
      stencilDepthPass - the function to perform if the fragment passes, both the depth and stencil test.
    • setScissorTestEnabled

      public void setScissorTestEnabled(boolean enabled)
      Sets if the scissor test is enabled.
      Parameters:
      enabled - true to enable, false to disable.
    • setScissorBounds

      public void setScissorBounds(int x, int y, int width, int height)
      Sets the bounds of the scissor test area.
      Parameters:
      x - the lower left corner, x-coordinate.
      y - the lower left corner, y-coordinate.
      width - the width of scissor area from the lower-left corner.
      height - the height of scissor area from the lower-left corner.
    • setBlendingEnabled

      public void setBlendingEnabled(boolean enabled)
      Sets if blending is enabled.
      Parameters:
      enabled - true to enable, false to disable.
    • setBlendingFunc

      public void setBlendingFunc(BlendArg source, BlendArg destination)
      Sets the current blending function.
      Parameters:
      source - the source fragment argument.
      destination - the destination fragment argument.
    • setBlendingFunc

      public void setBlendingFunc(BlendFunc func)
      Sets the current blending function.
      Parameters:
      func - the function to set the fragment arguments.
    • setFaceCullingEnabled

      public void setFaceCullingEnabled(boolean enabled)
      Sets if face culling is enabled.
      Parameters:
      enabled - true to enable, false to disable.
    • setFaceCullingSide

      public void setFaceCullingSide(FaceSide side)
      Sets the face side(s) that are culled if face culling is enabled.
      Parameters:
      side - the side to cull.
    • createTextureBuilder

      public TextureBuilder createTextureBuilder()
      Creates a texture builder.

      This texture builder aids in building texture objects, and its TextureBuilder.create() method will bind a new texture to its required target, send the data, set the filtering and build mipmaps, unbind the target, and return the new object.

      Limitations on this implementation version are: No 3D support, no compression, no auto mipmapgen, force RGBA.

      Returns:
      a new texture builder.
    • createTexture

      public OGLTexture createTexture()
      Creates a new texture object.
      Returns:
      a new, uninitialized texture object.
      Throws:
      GraphicsException - if the object could not be created.
    • destroyTexture

      public void destroyTexture(OGLTexture texture)
      Destroys a texture object.
      Parameters:
      texture - the texture to destroy.
    • getTexture

      public OGLTexture getTexture(TextureTargetType target)
      Gets a texture currently bound to a target.
      Parameters:
      target - the texture target.
      Returns:
      the texture, or null if no bound texture.
      Throws:
      UnsupportedOperationException - if the target type is unavailable in this version.
    • setTexture

      public void setTexture(TextureTargetType target, OGLTexture texture)
      Binds a texture object to the current active texture unit on the specified target. This also sets the texture's target identity: if this texture from this point forward is bound to any other target type, an exception will be thrown.
      Parameters:
      target - the texture target.
      texture - the texture to bind.
      Throws:
      UnsupportedOperationException - if the target type is unavailable in this version.
      GraphicsException - if the provided texture was previously bound to a different target.
    • setTextureFiltering

      public void setTextureFiltering(TextureTargetType target, TextureMinFilter minFilter, TextureMagFilter magFilter)
      Sets the filtering for the current texture bound to the specified target. Assumes an anisotropy value of 1.0f (not set if not supported).
      Parameters:
      target - the texture target.
      minFilter - the minification filter.
      magFilter - the magnification filter.
    • setTextureFiltering

      public void setTextureFiltering(TextureTargetType target, TextureMinFilter minFilter, TextureMagFilter magFilter, float anisotropy)
      Sets the filtering for the current texture bound to the specified target. If anisotropic filtering is unsupported, the anisotropy filtering constant is ignored.
      Parameters:
      target - the texture target.
      minFilter - the minification filter.
      magFilter - the magnification filter.
      anisotropy - the anisotropic filtering (2.0 or greater to enable, 1.0 is "off").
      Throws:
      UnsupportedOperationException - if the target type is unavailable in this version.
    • setTextureWrapping

      public void setTextureWrapping(TextureTargetType target, TextureWrapType wrapS)
      Sets the current wrapping for the current texture bound to the specified target.
      Parameters:
      target - the texture target.
      wrapS - the wrapping mode, S-axis.
      Throws:
      UnsupportedOperationException - if either provided type is unavailable in this version.
      GraphicsException - if the target is not a one-dimensionally-sampled target.
    • setTextureWrapping

      public void setTextureWrapping(TextureTargetType target, TextureWrapType wrapS, TextureWrapType wrapT)
      Sets the current wrapping for the current texture bound to the specified target.
      Parameters:
      target - the texture target.
      wrapS - the wrapping mode, S-axis.
      wrapT - the wrapping mode, T-axis.
      Throws:
      UnsupportedOperationException - if any provided type is unavailable in this version.
      GraphicsException - if the target is not a two-dimensionally-sampled target.
    • setTextureData

      public void setTextureData(TextureTargetType target, ByteBuffer imageData, ColorFormat colorFormat, TextureFormat format, int texlevel, int width, int border)
      Sends a texture to OpenGL's memory for the current texture bound to the specified target.
      Parameters:
      target - the texture target.
      imageData - the image to send.
      colorFormat - the pixel storage format of the buffer data.
      format - the internal texture format.
      texlevel - the mipmapping level to copy this into (0 is topmost).
      width - the texture width in texels.
      border - the texel border to add, if any.
      Throws:
      UnsupportedOperationException - if any provided type or format is unavailable in this version.
      GraphicsException - if the buffer provided is not direct, or if the target is not stored one-dimensionally.
    • setTextureData

      public void setTextureData(TextureTargetType target, ByteBuffer imageData, ColorFormat colorFormat, TextureFormat format, int texlevel, int width, int height, int border)
      Sends a texture into OpenGL's memory for the current texture bound to the specified target.
      Parameters:
      target - the texture target.
      imageData - the image to send.
      colorFormat - the pixel storage format of the buffer data.
      format - the internal format.
      texlevel - the mipmapping level to copy this into (0 is topmost).
      width - the texture width in texels.
      height - the texture height in texels.
      border - the texel border to add, if any.
      Throws:
      UnsupportedOperationException - if any provided type or format is unavailable in this version.
      GraphicsException - if the buffer provided is not direct, or if the target is not stored two-dimensionally.
    • setTextureSubData

      public void setTextureSubData(TextureTargetType target, ByteBuffer imageData, ColorFormat colorFormat, int texlevel, int width, int xoffs)
      Sends a subset of data to the current texture bound to the specified target already in OpenGL's memory.
      Parameters:
      target - the texture target.
      imageData - the image to send.
      colorFormat - the pixel storage format of the buffer data.
      texlevel - the mipmapping level to copy this into (0 is topmost).
      width - the texture width in texels.
      xoffs - the texel offset.
      Throws:
      UnsupportedOperationException - if any provided type or format is unavailable in this version.
      GraphicsException - if the buffer provided is not direct, or if the target is not stored one-dimensionally.
    • setTextureSubData

      public void setTextureSubData(TextureTargetType target, ByteBuffer imageData, ColorFormat colorFormat, int texlevel, int width, int height, int xoffs, int yoffs)
      Sends a subset of data to the current texture bound to the specified target already in OpenGL's memory.
      Parameters:
      target - the texture target.
      imageData - the image to send.
      colorFormat - the pixel storage format of the buffer data.
      texlevel - the mipmapping level to copy this into (0 is topmost).
      width - the texture width in texels.
      height - the texture height in texels.
      xoffs - the texel offset.
      yoffs - the texel offset.
      Throws:
      UnsupportedOperationException - if any provided type or format is unavailable in this version.
      GraphicsException - if the buffer provided is not direct, or if the target is not stored two-dimensionally.
    • setTextureDataFromReadBuffer

      public void setTextureDataFromReadBuffer(TextureTargetType target, TextureFormat format, int texlevel, int srcX, int srcY, int width, int border)
      Copies the contents of the current read frame buffer into the current texture bound to the specified target.
      Parameters:
      target - the texture target.
      format - the internal texture format.
      texlevel - the mipmapping level to copy this into (0 is topmost level).
      srcX - the screen-aligned x-coordinate of what to grab from the buffer (0 is the left side of the screen).
      srcY - the screen-aligned y-coordinate of what to grab from the buffer (0 is the bottom of the screen).
      width - the width of the screen in pixels to grab.
      border - the texel border to add, if any.
      Throws:
      UnsupportedOperationException - if any provided type or format is unavailable in this version.
      GraphicsException - if the target is not stored one-dimensionally.
    • setTextureDataFromReadBuffer

      public void setTextureDataFromReadBuffer(TextureTargetType target, TextureFormat format, int texlevel, int srcX, int srcY, int width, int height, int border)
      Copies the contents of the current read frame buffer into the current texture bound to the specified target.
      Parameters:
      target - the texture target.
      format - the internal format.
      texlevel - the mipmapping level to copy this into (0 is topmost level).
      srcX - the screen-aligned x-coordinate of what to grab from the buffer (0 is the left side of the screen).
      srcY - the screen-aligned y-coordinate of what to grab from the buffer (0 is the bottom of the screen).
      width - the width of the screen in pixels to grab.
      height - the height of the screen in pixels to grab.
      border - the texel border to add, if any.
      Throws:
      UnsupportedOperationException - if any provided type or format is unavailable in this version.
      GraphicsException - if the target is not stored two-dimensionally.
    • setTextureSubDataFromReadBuffer

      public void setTextureSubDataFromReadBuffer(TextureTargetType target, int texlevel, int xoffset, int srcX, int srcY, int width)
      Copies the contents of the current read frame buffer into the current texture bound to the specified target already in OpenGL's memory.
      Parameters:
      target - the texture target.
      texlevel - the mipmapping level to copy this into (0 is topmost level).
      xoffset - the offset in pixels on this texture (x-coordinate) to put this texture data.
      srcX - the screen-aligned x-coordinate of what to grab from the buffer (0 is the left side of the screen).
      srcY - the screen-aligned y-coordinate of what to grab from the buffer (0 is the bottom of the screen).
      width - the width of the screen in pixels to grab.
      Throws:
      UnsupportedOperationException - if the target type is unavailable in this version.
      GraphicsException - if the target is not stored one-dimensionally.
    • setTextureSubDataFromReadBuffer

      public void setTextureSubDataFromReadBuffer(TextureTargetType target, int texlevel, int xoffset, int yoffset, int srcX, int srcY, int width, int height)
      Copies the contents of the current read frame buffer into the current texture bound to the specified target already in OpenGL's memory.
      Parameters:
      target - the texture target.
      texlevel - the mipmapping level to copy this into (0 is topmost level).
      xoffset - the offset in pixels on this texture (x-coordinate) to put this texture data.
      yoffset - the offset in pixels on this texture (y-coordinate) to put this texture data.
      srcX - the screen-aligned x-coordinate of what to grab from the buffer (0 is the left side of the screen).
      srcY - the screen-aligned y-coordinate of what to grab from the buffer (0 is the bottom of the screen).
      width - the width of the screen in pixels to grab.
      height - the height of the screen in pixels to grab.
      Throws:
      UnsupportedOperationException - if the target type is unavailable in this version.
      GraphicsException - if the target is not stored two-dimensionally.
    • unsetTexture

      public void unsetTexture(TextureTargetType target)
      Unbinds a texture currently bound to a target.
      Parameters:
      target - the texture target.
      Throws:
      UnsupportedOperationException - if the target type is unavailable in this version.
    • drawGeometryArray

      public void drawGeometryArray(GeometryType geometryType, int offset, int elementCount)
      Draws geometry using the current bound, enabled coordinate arrays/buffers as data.
      Parameters:
      geometryType - the geometry type - tells how to interpret the data.
      offset - the starting offset in the bound buffers (in elements).
      elementCount - the number of elements to draw using bound buffers. NOTE: an element is in terms of array elements, so if the bound buffers describe the coordinates of 4 vertices, elementCount should be 4.
    • drawGeometryElements

      public void drawGeometryElements(GeometryType geometryType, DataType dataType, int count, int offset)
      Draws geometry using the current bound, enabled coordinate arrays/buffers as data, plus an element buffer to describe the ordering.
      Parameters:
      geometryType - the geometry type - tells how to interpret the data.
      dataType - the data type of the indices in the BufferTargetType.INDICES-bound buffer (must be an unsigned type).
      count - the amount of element indices to interpret in the BufferTargetType.INDICES-bound buffer.
      offset - the starting offset in the index buffer (in elements).