create_index_vbo.h 839 B

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