dd_filetomesh.h 834 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef DD_FILETOMESH_H
  2. #define DD_FILETOMESH_H
  3. /* Needs mesh, to store data into */
  4. #include "dd_mesh.h"
  5. /* Files supported */
  6. #define DD_PLY 0
  7. #define DD_OBJ 1
  8. /* Settings for different things */
  9. /* Mirroring - can be piped together for multiple mirroring */
  10. #define DD_FILETOMESH_SETTINGS_MIRROR_X 1
  11. #define DD_FILETOMESH_SETTINGS_MIRROR_Y 2
  12. #define DD_FILETOMESH_SETTINGS_MIRROR_Z 4
  13. /* Vertex attributes to parse */
  14. #define DD_FILETOMESH_SETTINGS_POSITION 8
  15. #define DD_FILETOMESH_SETTINGS_COLOUR 16
  16. #define DD_FILETOMESH_SETTINGS_TEX_COORD 32
  17. /* a mesh with all the asked data loaded
  18. */
  19. struct dd_loaded_mesh {
  20. int vcount;
  21. float *v;
  22. float *c;
  23. float *t;
  24. };
  25. /* Creates a loaded mesh from a file */
  26. int dd_filetomesh(struct dd_loaded_mesh *m, const char *path, int settings, int file_type);
  27. #endif /* DD_FILETOMESH_H */