dd_object.h 644 B

1234567891011121314151617181920212223242526272829
  1. #ifndef DD_OBJECT_H
  2. #define DD_OBJECT_H
  3. /* THIS IS STILL EXPERIMENTAL */
  4. /* object is a mesh that exists inside a 3d world
  5. * its a simple combination of a mesh and a matrix
  6. */
  7. #include "dd_mesh.h"
  8. #include "dd_matrix.h"
  9. /* object struct */
  10. struct dd_object {
  11. struct dd_mesh *mesh;
  12. float mat[16];
  13. };
  14. /* init object with a mesh and a matrix, if any of those is 0, just
  15. * allocate new memory for them, and expect user to load them manually
  16. * (see dd_mesh.h and dd_matrix.h on how to do that)
  17. */
  18. int dd_object_init(struct dd_object *o, struct dd_mesh *mesh, float mat[16]);
  19. /* draw */
  20. void dd_object_draw(struct dd_object *o);
  21. #endif