Package cz.fidentis.analyst.glsl.buffers
Interface GlslBuffer
- All Known Subinterfaces:
AtomicCounterBuffer
,FrameBuffer
,ImageBuffer
,PixelUnpackBuffer
,SsboBuffer
,TextureBuffer
- All Known Implementing Classes:
AbstractBuffer
,AtomicCounterBufferImpl
,FrameBufferImpl
,ImageBufferImpl
,PixelUnpackBufferImpl
,SsboBufferImpl
,TextureBufferImpl
public interface GlslBuffer
A GLSL buffer.
Every buffer instance should be included in some GlslBufferGroup
and managed (e.g., instantiated)
through this group.
Buffers are further separated by their OpenGL targets, e.g., GL_SHADER_STORAGE_BUFFER
(SSBO buffers),
GL_TEXTURE_2D
, GL_PIXEL_UNPACK_BUFFER
, etc. The targets mainly differ in the buffer allocation.
See corresponding sub-interfaces for more details.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bind()
Binds this buffer to the OpenGL context (binding points of GPU rendering pipeline), so it become visible for shaders.int
Returns binding index used in code of GLSL shaders.Returns buffer name (enum defined in this API)int
Returns the name (ID) under which is the buffer registered inside the OpenGL context.int
Returns the OpenGL target.com.jogamp.opengl.GLContext
Returns the OpenGL context under which is the buffer registered.
-
Method Details
-
getBufferName
BufferDef getBufferName()Returns buffer name (enum defined in this API)- Returns:
- buffer name
-
getBindingIndex
int getBindingIndex()Returns binding index used in code of GLSL shaders. Biding index of value -1 means that the biding index is not used/relevant for this buffer.- Returns:
- binding index.
-
getGlName
int getGlName()Returns the name (ID) under which is the buffer registered inside the OpenGL context.- Returns:
- GLSL name (ID)
-
glContext
com.jogamp.opengl.GLContext glContext()Returns the OpenGL context under which is the buffer registered.- Returns:
- OpenGL context
-
getGlTarget
int getGlTarget()Returns the OpenGL target.- Returns:
- the OpenGL target
-
bind
void bind()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 aGlslBufferGroup
, useGlslBufferGroup.bindBuffer(cz.fidentis.analyst.glsl.buffers.BufferDef)
to bind buffers individually orGlslBufferGroup.bindSsboBuffers()
to allocate all SSBO buffers at once.
-