Class NativeBufferPool

java.lang.Object
org.oscim.utils.pool.Pool<org.oscim.renderer.NativeBufferPool.BufferItem>
org.oscim.renderer.NativeBufferPool

public class NativeBufferPool extends Pool<org.oscim.renderer.NativeBufferPool.BufferItem>
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)
  • Constructor Details

    • NativeBufferPool

      public NativeBufferPool()
  • Method Details

    • createItem

      protected org.oscim.renderer.NativeBufferPool.BufferItem createItem()
      Specified by:
      createItem in class Pool<org.oscim.renderer.NativeBufferPool.BufferItem>
    • get

      public org.oscim.renderer.NativeBufferPool.BufferItem get(int size)
    • releaseBuffers

      public void releaseBuffers()
    • getShortBuffer

      public ShortBuffer getShortBuffer(int size)
      Only use on GL Thread! Get a native ShortBuffer for temporary use.
    • getFloatBuffer

      public FloatBuffer getFloatBuffer(int size)
      Only use on GL Thread! Get a native FloatBuffer for temporary use.
    • getIntBuffer

      public IntBuffer getIntBuffer(int size)
      Only use on GL Thread! Get a native IntBuffer for temporary use.