create_mesh_vbo.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "create_mesh_vbo.h"
  9. #include "create_vector_vbo.h"
  10. #include "create_index_vbo.h"
  11. // http://www.songho.ca/opengl/gl_vbo.html#create
  12. IGL_INLINE void igl::opengl::create_mesh_vbo(
  13. const Eigen::MatrixXd & V,
  14. const Eigen::MatrixXi & F,
  15. GLuint & V_vbo_id,
  16. GLuint & F_vbo_id)
  17. {
  18. // Create VBO for vertex position vectors
  19. create_vector_vbo(V,V_vbo_id);
  20. // Create VBO for face index lists
  21. create_index_vbo(F,F_vbo_id);
  22. }
  23. // http://www.songho.ca/opengl/gl_vbo.html#create
  24. IGL_INLINE void igl::opengl::create_mesh_vbo(
  25. const Eigen::MatrixXd & V,
  26. const Eigen::MatrixXi & F,
  27. const Eigen::MatrixXd & N,
  28. GLuint & V_vbo_id,
  29. GLuint & F_vbo_id,
  30. GLuint & N_vbo_id)
  31. {
  32. // Create VBOs for faces and vertices
  33. create_mesh_vbo(V,F,V_vbo_id,F_vbo_id);
  34. // Create VBO for normal vectors
  35. create_vector_vbo(N,N_vbo_id);
  36. }
  37. #ifdef IGL_STATIC_LIBRARY
  38. // Explicit template specialization
  39. #endif