vertex_array.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef IGL_OPENGL_VERTEX_ARRAY_H
  2. #define IGL_OPENGL_VERTEX_ARRAY_H
  3. #include "../igl_inline.h"
  4. #include "gl.h"
  5. #include <Eigen/Core>
  6. namespace igl
  7. {
  8. namespace opengl
  9. {
  10. /// Create a GL_VERTEX_ARRAY for a given mesh (V,F)
  11. ///
  12. /// @param[in] V #V by dim list of mesh vertex positions
  13. /// @param[in] F #F by 3 list of mesh triangle indices into V
  14. /// @param[out] va_id id of vertex array
  15. /// @param[out] ab_id id of array buffer (vertex buffer object)
  16. /// @param[out] eab_id id of element array buffer (element/face buffer object)
  17. ///
  18. /// \note Unlike most libigl functions, the **input** Eigen matrices must
  19. /// be `Eigen::PlainObjectBase` because we want to directly access it's
  20. /// underlying storage. It cannot be `Eigen::MatrixBase` (see
  21. /// http://stackoverflow.com/questions/25094948/)
  22. template <
  23. typename DerivedV,
  24. typename DerivedF>
  25. IGL_INLINE void vertex_array(
  26. const Eigen::PlainObjectBase<DerivedV> & V,
  27. const Eigen::PlainObjectBase<DerivedF> & F,
  28. GLuint & va_id,
  29. GLuint & ab_id,
  30. GLuint & eab_id);
  31. }
  32. }
  33. #ifndef IGL_STATIC_LIBRARY
  34. # include "vertex_array.cpp"
  35. #endif
  36. #endif