create_mesh_vbo.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #ifndef IGL_NO_OPENGL
  10. #include "create_vector_vbo.h"
  11. #include "create_index_vbo.h"
  12. // http://www.songho.ca/opengl/gl_vbo.html#create
  13. IGL_INLINE void igl::create_mesh_vbo(
  14. const Eigen::MatrixXd & V,
  15. const Eigen::MatrixXi & F,
  16. GLuint & V_vbo_id,
  17. GLuint & F_vbo_id)
  18. {
  19. // Create VBO for vertex position vectors
  20. create_vector_vbo(V,V_vbo_id);
  21. // Create VBO for face index lists
  22. create_index_vbo(F,F_vbo_id);
  23. }
  24. // http://www.songho.ca/opengl/gl_vbo.html#create
  25. IGL_INLINE void igl::create_mesh_vbo(
  26. const Eigen::MatrixXd & V,
  27. const Eigen::MatrixXi & F,
  28. const Eigen::MatrixXd & N,
  29. GLuint & V_vbo_id,
  30. GLuint & F_vbo_id,
  31. GLuint & N_vbo_id)
  32. {
  33. // Create VBOs for faces and vertices
  34. create_mesh_vbo(V,F,V_vbo_id,F_vbo_id);
  35. // Create VBO for normal vectors
  36. create_vector_vbo(N,N_vbo_id);
  37. }
  38. #ifdef IGL_STATIC_LIBRARY
  39. // Explicit template specialization
  40. #endif
  41. #endif