create_vector_vbo.h 791 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef IGL_CREATE_VECTOR_VBO_H
  2. #define IGL_CREATE_VECTOR_VBO_H
  3. #ifndef IGL_NO_OPENGL
  4. #include "igl_inline.h"
  5. // NOTE: It wouldn't be so hard to template this using Eigen's templates
  6. #include <Eigen/Core>
  7. #include "OpenGL_convenience.h"
  8. // Create a VBO (Vertex Buffer Object) for a list of vectors:
  9. // GL_ARRAY_BUFFER for the vectors (V)
  10. namespace igl
  11. {
  12. // Templates:
  13. // T should be a eigen matrix primitive type like int or double
  14. // Inputs:
  15. // V m by n eigen Matrix of type T values
  16. // Outputs:
  17. // V_vbo_id buffer id for vectors
  18. //
  19. template <typename T>
  20. IGL_INLINE void create_vector_vbo(
  21. const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> & V,
  22. GLuint & V_vbo_id);
  23. }
  24. #ifdef IGL_HEADER_ONLY
  25. # include "create_vector_vbo.cpp"
  26. #endif
  27. #endif
  28. #endif