Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1.         buffer.nextFrame();
  2.  
  3.         buffer.bind();
  4.         glBindVertexArray(1);
  5.  
  6.         buffer.ensureSize(600 * 32);
  7.  
  8.         FloatBuffer mapped = buffer.map().asFloatBuffer();
  9.  
  10.         float[] toput = new float[600 * 8];
  11.  
  12.         for (int i = 0; i < 100; i++) {
  13.             System.arraycopy(new float[]{-1, 1, 0, 1, 0, 1, 0, 0}, 0, toput, i * 48, 8);
  14.             System.arraycopy(new float[]{1, 1, 0, 0, 1, 1, 1, 0}, 0, toput, i * 48 + 8, 8);
  15.             System.arraycopy(new float[]{1, -1, 0, 1, 1, 0, 1, 1}, 0, toput, i * 48 + 16, 8);
  16.             System.arraycopy(new float[]{-1, 1, 0, 1, 0, 1, 0, 0}, 0, toput, i * 48 + 24, 8);
  17.             System.arraycopy(new float[]{1, -1, 0, 0, 1, 1, 1, 1}, 0, toput, i * 48 + 32, 8);
  18.             System.arraycopy(new float[]{-1, -1, 0, 1, 1, 0, 0, 1}, 0, toput, i * 48 + 40, 8);
  19.         }
  20.  
  21.         mapped.put(toput);
  22.  
  23.         buffer.unmap();
  24.  
  25.         drawBuffer(buffer);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement