Class ImageBufferImpl
java.lang.Object
cz.fidentis.analyst.glsl.buffers.impl.AbstractBuffer
cz.fidentis.analyst.glsl.buffers.impl.ImageBufferImpl
- All Implemented Interfaces:
GlslBuffer
,ImageBuffer
A texture buffer storing an image.
This buffer is used for the
GL_TEXTURE_2D
OpenGL target.-
Constructor Summary
ConstructorsConstructorDescriptionImageBufferImpl
(BufferDef bufferName, com.jogamp.opengl.GLContext glContext, int internalFormat, int access) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
allocate
(int width, int height, int format, int type, int filter) Allocates the buffer usingglTexImage2D
OpenGL methodvoid
bind()
Binds this buffer to the OpenGL context (binding points of GPU rendering pipeline), so it become visible for shaders.void
clear
(long val) Clear the buffer with given value.Methods inherited from class cz.fidentis.analyst.glsl.buffers.impl.AbstractBuffer
getBindingIndex, getBufferName, getGlName, getGlTarget, glContext, setGlName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cz.fidentis.analyst.glsl.buffers.GlslBuffer
getBindingIndex, getBufferName, getGlName, getGlTarget, glContext
-
Constructor Details
-
ImageBufferImpl
public ImageBufferImpl(BufferDef bufferName, com.jogamp.opengl.GLContext glContext, int internalFormat, int access) Constructor.- Parameters:
bufferName
- Buffer nameglContext
- OpenGL contextinternalFormat
- Theformat
parameter of theglBindImageTexture
function andinternalFormat
of theglTexBuffer
andglTexImage2D
functionsaccess
- Theaccess
parameter of theglBindImageTexture
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 usingglTexImage2D
OpenGL method- Specified by:
allocate
in interfaceImageBuffer
- Parameters:
width
-glTexImage2D()
width parameterheight
-glTexImage2D()
height parameterformat
-glTexImage2D()
format parametertype
-glTexImage2D()
format parameterfilter
- 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 aGlslBufferGroup
, useGlslBufferGroup.bindBuffer(cz.fidentis.analyst.glsl.buffers.BufferDef)
to bind buffers individually orGlslBufferGroup.bindSsboBuffers()
to allocate all SSBO buffers at once.- Specified by:
bind
in interfaceGlslBuffer
-
clear
public void clear(long val) Description copied from interface:ImageBuffer
Clear the buffer with given value.- Specified by:
clear
in interfaceImageBuffer
- Parameters:
val
- Value
-