Class ImageBufferImpl

java.lang.Object
cz.fidentis.analyst.glsl.buffers.impl.AbstractBuffer
cz.fidentis.analyst.glsl.buffers.impl.ImageBufferImpl
All Implemented Interfaces:
GlslBuffer, ImageBuffer

public class ImageBufferImpl extends AbstractBuffer implements ImageBuffer
A texture buffer storing an image. This buffer is used for the GL_TEXTURE_2D OpenGL target.
  • Constructor Details

    • ImageBufferImpl

      public ImageBufferImpl(BufferDef bufferName, com.jogamp.opengl.GLContext glContext, int internalFormat, int access)
      Constructor.
      Parameters:
      bufferName - Buffer name
      glContext - OpenGL context
      internalFormat - The format parameter of the glBindImageTexture function and internalFormat of the glTexBuffer and glTexImage2D functions
      access - The access parameter of the glBindImageTexture function
  • Method Details

    • allocate

      public void allocate(int width, int height, int format, int type, int filter)
      Description copied from interface: ImageBuffer
      Allocates the buffer using glTexImage2D OpenGL method
      Specified by:
      allocate in interface ImageBuffer
      Parameters:
      width - glTexImage2D() width parameter
      height - glTexImage2D() height parameter
      format - glTexImage2D() format parameter
      type - glTexImage2D() format parameter
      filter - Filtering mode
    • bind

      public void bind()
      Description copied from interface: GlslBuffer
      Binds this buffer to the OpenGL context (binding points of GPU rendering pipeline), so it become visible for shaders. Buffers can be bound to their binding points even unallocated. Do not use this method directly. As every buffer should be included in a GlslBufferGroup, use GlslBufferGroup.bindBuffer(cz.fidentis.analyst.glsl.buffers.BufferDef) to bind buffers individually or GlslBufferGroup.bindSsboBuffers() to allocate all SSBO buffers at once.
      Specified by:
      bind in interface GlslBuffer
    • clear

      public void clear(long val)
      Description copied from interface: ImageBuffer
      Clear the buffer with given value.
      Specified by:
      clear in interface ImageBuffer
      Parameters:
      val - Value