Class JoGLBuffersManager
java.lang.Object
org.scilab.forge.scirenderer.implementation.jogl.buffers.JoGLBuffersManager
- All Implemented Interfaces:
BuffersManager
- Author:
- Pierre Lando
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbindColorsBuffer(com.jogamp.opengl.GL2 gl, ElementsBuffer buffer) Bind the given buffer as color buffer.intbindIndicesBuffer(com.jogamp.opengl.GL2 gl, IndicesBuffer buffer) Bind the given buffer as indices buffer.intbindNormalsBuffer(com.jogamp.opengl.GL2 gl, ElementsBuffer buffer) Bind the given buffer as normal buffer.intbindTextureCoordinatesBuffer(com.jogamp.opengl.GL2 gl, ElementsBuffer buffer) Bind the given buffer as texture coordinate buffer.intbindVertexBuffer(com.jogamp.opengl.GL2 gl, ElementsBuffer buffer) Bind the given buffer as vertex buffer.Create an elements buffer.Create an indices buffer.voiddispose(Collection<? extends DataBuffer> buffers) Release all resources used by the given buffers.voiddispose(DataBuffer buffer) Release all resources used by the given buffer.voidglReload()Called when previous OpenGl context is gone.voidglSynchronize(com.jogamp.opengl.GL2 gl) Called before rendering for synchronisation.
-
Constructor Details
-
JoGLBuffersManager
public JoGLBuffersManager()Default constructor.
-
-
Method Details
-
createElementsBuffer
Description copied from interface:BuffersManagerCreate an elements buffer.- Specified by:
createElementsBufferin interfaceBuffersManager- Returns:
- a new elements buffer.
-
createIndicesBuffer
Description copied from interface:BuffersManagerCreate an indices buffer.- Specified by:
createIndicesBufferin interfaceBuffersManager- Returns:
- a new indices buffer.
-
dispose
Description copied from interface:BuffersManagerRelease all resources used by the given buffer.- Specified by:
disposein interfaceBuffersManager- Parameters:
buffer- the given buffer.
-
dispose
Description copied from interface:BuffersManagerRelease all resources used by the given buffers.- Specified by:
disposein interfaceBuffersManager- Parameters:
buffers- the given buffers.
-
glReload
public void glReload()Called when previous OpenGl context is gone. -
glSynchronize
public void glSynchronize(com.jogamp.opengl.GL2 gl) Called before rendering for synchronisation. Clean dead buffers.- Parameters:
gl- the OpenGl context.
-
bindVertexBuffer
Bind the given buffer as vertex buffer.- Parameters:
gl- the OpenGl context where the buffer is bind.buffer- the buffer to bind.- Returns:
- the number of element actually bind.
-
bindNormalsBuffer
Bind the given buffer as normal buffer.- Parameters:
gl- the OpenGl context where the buffer is bind.buffer- the buffer to bind.- Returns:
- the number of element actually bind.
-
bindTextureCoordinatesBuffer
Bind the given buffer as texture coordinate buffer.- Parameters:
gl- the OpenGl context where the buffer is bind.buffer- the buffer to bind.- Returns:
- the number of element actually bind.
-
bindColorsBuffer
Bind the given buffer as color buffer.- Parameters:
gl- the OpenGl context where the buffer is bind.buffer- the buffer to bind.- Returns:
- the number of element actually bind.
-
bindIndicesBuffer
Bind the given buffer as indices buffer.- Parameters:
gl- the OpenGl context where the buffer is bind.buffer- the buffer to bind.- Returns:
- the number of element actually bind.
-