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);
- }
Advertisement
Add Comment
Please, Sign In to add comment