/src/renderer/visual.h

https://bitbucket.org/vivkin/gam3b00bs/ · C Header · 54 lines · 28 code · 14 blank · 12 comment · 0 complexity · a16b43e1a0f2c59f05bd05eb46e1376d MD5 · raw file

  1. #pragma once
  2. //-----------------------------------------------------------------------------
  3. #include "renderer/device.h"
  4. #include "renderer/mesh.h"
  5. //-----------------------------------------------------------------------------
  6. struct visual_t
  7. {
  8. D3DMATERIAL9 material;
  9. mesh_h mesh;
  10. texture_h texture[2];
  11. vertex_layout_h v_layout;
  12. D3DXVECTOR3 position;
  13. float pitch;
  14. float yaw;
  15. float roll;
  16. float scaleu; // uniform scale
  17. D3DXMATRIX transform;
  18. };
  19. typedef visual_t* visual_h;
  20. //-----------------------------------------------------------------------------
  21. visual_h visual_create( const char* mesh_name,
  22. const char* texture0_path,
  23. const char* texture1_path );
  24. //-----------------------------------------------------------------------------
  25. visual_h visual_create( mesh_h mesh, texture_h tex0, texture_h tex1 );
  26. //-----------------------------------------------------------------------------
  27. void visual_set_position( visual_h vis, const D3DXVECTOR3& pos );
  28. //-----------------------------------------------------------------------------
  29. void visual_set_rotation( visual_h vis, float pitch, float yaw, float roll );
  30. //-----------------------------------------------------------------------------
  31. void visual_set_scaleu( visual_h vis, float scale );
  32. //-----------------------------------------------------------------------------
  33. void visual_remove( visual_h vis );
  34. //-----------------------------------------------------------------------------
  35. void visual_draw( visual_h vis );
  36. //-----------------------------------------------------------------------------
  37. void visual_render( visual_h vis );
  38. //-----------------------------------------------------------------------------
  39. void visuals_render_all();
  40. //-----------------------------------------------------------------------------