SHARE
TWEET
Untitled
a guest
Dec 27th, 2014
6
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- public void compositeVAO(int width, int height) {
- float[] vertices = new float[] {
- -1.0f, 1.0f,
- -1.0f, -1.0f,
- 1.0f, 1.0f,
- 1.0f, -1.0f
- };
- FloatBuffer verts = BufferUtils.createFloatBuffer(vertices.length);
- verts.put(vertices);
- verts.flip();
- vao = glGenVertexArrays();
- glBindVertexArray(vao);
- int vbo = glGenBuffers();
- glBindBuffer(GL_ARRAY_BUFFER, vbo);
- glBufferData(GL_ARRAY_BUFFER, verts, GL_STATIC_DRAW);
- glVertexAttribPointer(position, 2, GL_FLOAT, false, 0, 0);
- glEnableVertexAttribArray(position);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- }
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.

