create_index_vbo.h 879 B

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