Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- glBindBuffer(GL_ARRAY_BUFFER, abo);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, eabo);
- GLsizei stride = sizeof(float) * 8;
- glVertexAttribPointer(vloc, 3, GL_FLOAT, GL_FALSE, stride, (const void *)0);
- glVertexAttribPointer(nloc, 3, GL_FLOAT, GL_FALSE, stride, (const void *)12);
- glVertexAttribPointer(tloc, 2, GL_FLOAT, GL_FALSE, stride, (const void *)24);
- if (vloc >= 0) glEnableVertexAttribArray(vloc);
- if (nloc >= 0) glEnableVertexAttribArray(nloc);
- if (tloc >= 0) glEnableVertexAttribArray(tloc);
- glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_SHORT, 0);
- if (vloc >= 0) glDisableVertexAttribArray(vloc);
- if (nloc >= 0) glDisableVertexAttribArray(nloc);
- if (tloc >= 0) glDisableVertexAttribArray(tloc);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement