create_vector_vbo.h 986 B

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