Class PixelUnpackBufferImpl

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

public class PixelUnpackBufferImpl extends AbstractBuffer implements PixelUnpackBuffer
A buffer for GL_PIXEL_UNPACK_BUFFER target.
  • Constructor Details

    • PixelUnpackBufferImpl

      public PixelUnpackBufferImpl(BufferDef bufferName, com.jogamp.opengl.GLContext glContext, int usage, long itemSize)
      Constructor.
      Parameters:
      bufferName - buffer name
      glContext - OpenGL context
      usage - OpenGL usage type
      itemSize - The size of buffer's items
  • Method Details

    • 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
    • getUsage

      public int getUsage()
      Description copied from interface: PixelUnpackBuffer
      Returns buffer usage type
      Specified by:
      getUsage in interface PixelUnpackBuffer
      Returns:
      usage type
    • getItemSize

      public long getItemSize()
      Description copied from interface: PixelUnpackBuffer
      This buffer stores some amount of items of the same type (integers, floats, etc.). Therefore, this method returns the size (number of bytes) of a single item.
      Specified by:
      getItemSize in interface PixelUnpackBuffer
      Returns:
      items' size
    • allocate

      public void allocate(long items, boolean reset)
      Description copied from interface: PixelUnpackBuffer
      Allocates memory for this buffer on GPU. Can be used multiple times to resize the buffer. Resulting buffer will occupy items * PixelUnpackBuffer.getItemSize() bytes.
      Specified by:
      allocate in interface PixelUnpackBuffer
      Parameters:
      items - how many items are going to be in the buffer (resulting buffer will have items * ssboDef.getItemSize() bytes)
      reset - if true, then fills the buffer by zeros