You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
540 B

4 years ago
  1. #pragma once
  2. #include "ggl.h"
  3. struct Vertex {
  4. float Position[4];
  5. float Color[4];
  6. float Texcoord[4];
  7. float Normal[4];
  8. };
  9. class VertexBuffer {
  10. public:
  11. Vertex *mVertexes;
  12. int mVertexCount;
  13. GLuint mVBO;
  14. void SetSize(int vertexCount);
  15. void SetPosition(int index, float x, float y, float z, float w = 1.0f);
  16. void SetColor(int index, float r, float g, float b, float a = 1.0);
  17. void SetTexcoord(int index, float x, float y);
  18. void SetNormal(int index, float x, float y, float z);
  19. void Bind();
  20. void Unbind();
  21. Vertex& Get(int index);
  22. };