create_index_vbo.h 856 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef IGL_CREATE_INDEX_VBO_H
  2. #define IGL_CREATE_INDEX_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 indices:
  19. // GL_ELEMENT_ARRAY_BUFFER_ARB for the triangle indices (F)
  20. namespace igl
  21. {
  22. // Inputs:
  23. // F #F by 3 eigen Matrix of face (triangle) indices
  24. // Outputs:
  25. // F_vbo_id buffer id for face indices
  26. //
  27. IGL_INLINE void create_index_vbo(
  28. const Eigen::MatrixXi & F,
  29. GLuint & F_vbo_id);
  30. }
  31. #ifdef IGL_HEADER_ONLY
  32. # include "create_index_vbo.cpp"
  33. #endif
  34. #endif