bind_vertex_attrib_array.h 974 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef IGL_OPENGL_BIND_VERTEX_ATTRIB_ARRAY_H
  2. #define IGL_OPENGL_BIND_VERTEX_ATTRIB_ARRAY_H
  3. #include "gl.h"
  4. #include "../igl_inline.h"
  5. #include <Eigen/Core>
  6. #include <string>
  7. namespace igl
  8. {
  9. namespace opengl
  10. {
  11. // Bind a per-vertex array attribute and refresh its contents from an Eigen
  12. // matrix
  13. //
  14. // Inputs:
  15. // program_shader id of shader program
  16. // name name of attribute in vertex shader
  17. // bufferID id of buffer to bind to
  18. // M #V by dim matrix of per-vertex data
  19. // refresh whether to actually call glBufferData or just bind the buffer
  20. // Returns id of named attribute in shader
  21. IGL_INLINE GLint bind_vertex_attrib_array(
  22. const GLuint program_shader,
  23. const std::string &name,
  24. GLuint bufferID,
  25. const Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> &M,
  26. bool refresh);
  27. }
  28. }
  29. #ifndef IGL_STATIC_LIBRARY
  30. #include "bind_vertex_attrib_array.cpp"
  31. #endif
  32. #endif