create_vector_vbo.h 963 B

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