vertex_array.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef IGL_OPENGL_VERTEX_ARRAY_H
  2. #define IGL_OPENGL_VERTEX_ARRAY_H
  3. #include <igl/opengl/../igl_inline.h>
  4. #include <igl/opengl/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. // Inputs:
  13. // V #V by dim list of mesh vertex positions
  14. // F #F by 3 list of mesh triangle indices into V
  15. // Outputs:
  16. // va_id id of vertex array
  17. // ab_id id of array buffer (vertex buffer object)
  18. // eab_id id of element array buffer (element/face buffer object)
  19. //
  20. template <
  21. typename DerivedV,
  22. typename DerivedF>
  23. IGL_INLINE void vertex_array(
  24. // Note: Unlike most libigl functions, the **input** Eigen matrices must
  25. // be `Eigen::PlainObjectBase` because we want to directly access it's
  26. // underlying storage. It cannot be `Eigen::MatrixBase` (see
  27. // http://stackoverflow.com/questions/25094948/)
  28. const Eigen::PlainObjectBase<DerivedV> & V,
  29. const Eigen::PlainObjectBase<DerivedF> & F,
  30. GLuint & va_id,
  31. GLuint & ab_id,
  32. GLuint & eab_id);
  33. }
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "vertex_array.cpp"
  37. #endif
  38. #endif