create_index_vbo.h 787 B

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