SHARE
TWEET

Untitled

a guest Dec 27th, 2014 6 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void compositeVAO(int width, int height) {
  2.                 float[] vertices = new float[] {
  3.                         -1.0f, 1.0f,
  4.                         -1.0f, -1.0f,
  5.                         1.0f, 1.0f,
  6.                         1.0f, -1.0f
  7.                 };
  8.                
  9.                 FloatBuffer verts = BufferUtils.createFloatBuffer(vertices.length);
  10.                 verts.put(vertices);
  11.                 verts.flip();
  12.                
  13.                 vao = glGenVertexArrays();
  14.                 glBindVertexArray(vao);
  15.                
  16.                 int vbo = glGenBuffers();
  17.                 glBindBuffer(GL_ARRAY_BUFFER, vbo);
  18.                 glBufferData(GL_ARRAY_BUFFER, verts, GL_STATIC_DRAW);
  19.  
  20.                 glVertexAttribPointer(position, 2, GL_FLOAT, false, 0, 0);
  21.                 glEnableVertexAttribArray(position);
  22.  
  23.                 glBindBuffer(GL_ARRAY_BUFFER, 0);
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top