create_mesh_vbo.cpp 920 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "create_mesh_vbo.h"
  2. #ifndef IGL_NO_OPENGL
  3. #include "create_vector_vbo.h"
  4. #include "create_index_vbo.h"
  5. // http://www.songho.ca/opengl/gl_vbo.html#create
  6. IGL_INLINE void igl::create_mesh_vbo(
  7. const Eigen::MatrixXd & V,
  8. const Eigen::MatrixXi & F,
  9. GLuint & V_vbo_id,
  10. GLuint & F_vbo_id)
  11. {
  12. // Create VBO for vertex position vectors
  13. create_vector_vbo(V,V_vbo_id);
  14. // Create VBO for face index lists
  15. create_index_vbo(F,F_vbo_id);
  16. }
  17. // http://www.songho.ca/opengl/gl_vbo.html#create
  18. IGL_INLINE void igl::create_mesh_vbo(
  19. const Eigen::MatrixXd & V,
  20. const Eigen::MatrixXi & F,
  21. const Eigen::MatrixXd & N,
  22. GLuint & V_vbo_id,
  23. GLuint & F_vbo_id,
  24. GLuint & N_vbo_id)
  25. {
  26. // Create VBOs for faces and vertices
  27. create_mesh_vbo(V,F,V_vbo_id,F_vbo_id);
  28. // Create VBO for normal vectors
  29. create_vector_vbo(N,N_vbo_id);
  30. }
  31. #ifndef IGL_HEADER_ONLY
  32. // Explicit template specialization
  33. #endif
  34. #endif