dd_mesh.h 786 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef DD_MESH_H
  2. #define DD_MESH_H
  3. /* Mesh attributes */
  4. #define DD_MESH_POS 1
  5. #define DD_MESH_COL 2
  6. /* Generic mesh that holds all the data needed to draw a mesh
  7. * like colors or normals
  8. * vcount : number of vertices
  9. * ar : array of pointers to vertex data
  10. * attr : array of attributes
  11. * for each attribute, there is an array of vertex data in `ar`
  12. * A mesh must be initialized before it can be drawn. The only proper
  13. * way to do that (so far) is with "file_to_mesh()" (from "file_to_mesh.h")
  14. */
  15. struct dd_mesh {
  16. int vcount;
  17. void *ar;
  18. char *attr;
  19. };
  20. /* Free and Draw functions */
  21. void dd_mesh_free(struct dd_mesh *m);
  22. void dd_mesh_draw(struct dd_mesh *m);
  23. struct dd_mesh2 {
  24. int vcount;
  25. float *pos;
  26. };
  27. void dd_mesh2_draw(struct dd_mesh2 *m);
  28. #endif /* MESH_H */