Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 841 Bytes

README.md

File metadata and controls

49 lines (39 loc) · 841 Bytes

GlisyVAO

Installation

$ clib install glisy/vao --save

Usage

#include <glisy/math.h>
#include <glisy/vao.h>

int
main (void) {
  const vec3 vertices[] = {
    vec3(-0.5, -0.5, +0.5),
    vec3(+0.5, -0.5, +0.5),
    vec3(-0.5, +0.5, +0.5),
    vec3(+0.5, +0.5, +0.5),

    vec3(-0.5, -0.5, -0.5),
    vec3(+0.5, -0.5, -0.5),
    vec3(-0.5, +0.5, -0.5),
    vec3(+0.5, +0.5, -0.5),
  };

  GlisyVAOAttribute vPosition;
  memset(&vPosition, 0, sizeof(vPosition));
  vPosition.buffer.data = (void *) vertices;
  vPosition.buffer.type = GL_FLOAT;
  vPosition.buffer.size = size;
  vPosition.buffer.usage = GL_STATIC_DRAW;
  vPosition.buffer.dimension = 3;

  GlisyVAO vao;
  glisyVAOInit(&vao);
  glisyVAOPush(&vao, &vPosition);
  glisyVAOBind(&vao);
  glisyVAOUpdate(&vao, 0);
  return 0;
}

License

MIT