create_vector_vbo.h 894 B

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