create_vector_vbo.h 946 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #else
  13. #define GL_GLEXT_PROTOTYPES
  14. # include <GL/gl.h>
  15. # include <GL/glext.h>
  16. #endif
  17. // Create a VBO (Vertex Buffer Object) for a list of vectors:
  18. // GL_ARRAY_BUFFER for the vectors (V)
  19. namespace igl
  20. {
  21. // Templates:
  22. // T should be a eigen matrix primitive type like int or double
  23. // Inputs:
  24. // V m by n eigen Matrix of type T values
  25. // Outputs:
  26. // V_vbo_id buffer id for vectors
  27. //
  28. template <typename T>
  29. IGL_INLINE void create_vector_vbo(
  30. const Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> & V,
  31. GLuint & V_vbo_id);
  32. }
  33. #ifdef IGL_HEADER_ONLY
  34. # include "create_vector_vbo.cpp"
  35. #endif
  36. #endif