Ejemplo n.º 1
0
 public void setBufferSize(
     GLBufferStateTracker bufferStateTracker, int target, GL caller, long size) {
   // Need to do some similar queries to getBufferSize below
   int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
   if (buffer != 0) {
     setDirectStateBufferSize(buffer, caller, size);
   }
   // We don't know the current buffer state. Note that the buffer
   // state tracker will have made the appropriate OpenGL query if it
   // didn't know what was going on, so at this point we have nothing
   // left to do except drop this piece of information on the floor.
 }
Ejemplo n.º 2
0
 public long getBufferSize(GLBufferStateTracker bufferStateTracker, int target, GL caller) {
   // See whether we know what buffer is currently bound to the given
   // state
   final int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
   if (0 != buffer) {
     return getBufferSizeImpl(target, buffer, caller);
   }
   // We don't know what's going on in this case; query the GL for an answer
   // FIXME: both functions return 'int' types, which is not suitable,
   // since buffer lenght is 64bit ?
   int[] tmp = new int[1];
   caller.glGetBufferParameteriv(target, GL.GL_BUFFER_SIZE, tmp, 0);
   if (DEBUG) {
     System.err.println("GLBufferSizeTracker.getBufferSize(): no cached buffer information");
   }
   return (long) tmp[0];
 }