Package org.oscim.renderer
Class NativeBufferPool
java.lang.Object
org.oscim.utils.pool.Pool<org.oscim.renderer.NativeBufferPool.BufferItem>
org.oscim.renderer.NativeBufferPool
Pool to retrieve temporary native buffer on GL-Thread:
This pool ensures to not use the same buffer to upload data twice
within a frame.
- Contrary to what the OpenGL doc says data seems *not* to be
always* copied after glBufferData returns...
- Somehow it does always copy when using Android GL bindings
but not when using libgdx bindings (LWJGL or AndroidGL20)
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.oscim.renderer.NativeBufferPool.BufferItemorg.oscim.renderer.NativeBufferPool.BufferItemget(int size) getFloatBuffer(int size) Only use on GL Thread! Get a native FloatBuffer for temporary use.getIntBuffer(int size) Only use on GL Thread! Get a native IntBuffer for temporary use.getShortBuffer(int size) Only use on GL Thread! Get a native ShortBuffer for temporary use.void
-
Constructor Details
-
NativeBufferPool
public NativeBufferPool()
-
-
Method Details
-
createItem
protected org.oscim.renderer.NativeBufferPool.BufferItem createItem()- Specified by:
createItemin classPool<org.oscim.renderer.NativeBufferPool.BufferItem>
-
get
public org.oscim.renderer.NativeBufferPool.BufferItem get(int size) -
releaseBuffers
public void releaseBuffers() -
getShortBuffer
Only use on GL Thread! Get a native ShortBuffer for temporary use. -
getFloatBuffer
Only use on GL Thread! Get a native FloatBuffer for temporary use. -
getIntBuffer
Only use on GL Thread! Get a native IntBuffer for temporary use.
-