Initial release
Some checks failed
My Build All / build_windows (push) Has been cancelled
My Build All / build_linux_portable (push) Has been cancelled
My Build All / build_linux_appimage (push) Has been cancelled
My Build All / build_macos (push) Has been cancelled
My Build All / Publish release assets (push) Has been cancelled
Shellcheck / Shellcheck (push) Has been cancelled
Some checks failed
My Build All / build_windows (push) Has been cancelled
My Build All / build_linux_portable (push) Has been cancelled
My Build All / build_linux_appimage (push) Has been cancelled
My Build All / build_macos (push) Has been cancelled
My Build All / Publish release assets (push) Has been cancelled
Shellcheck / Shellcheck (push) Has been cancelled
This commit is contained in:
commit
c661ddc2eb
16967 changed files with 4075897 additions and 0 deletions
24
deps_src/libigl/igl/opengl/bind_vertex_attrib_array.cpp
Normal file
24
deps_src/libigl/igl/opengl/bind_vertex_attrib_array.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include "bind_vertex_attrib_array.h"
|
||||
|
||||
IGL_INLINE GLint igl::opengl::bind_vertex_attrib_array(
|
||||
const GLuint program_shader,
|
||||
const std::string &name,
|
||||
GLuint bufferID,
|
||||
const Eigen::Matrix<float,Eigen::Dynamic,Eigen::Dynamic,Eigen::RowMajor> &M,
|
||||
bool refresh)
|
||||
{
|
||||
GLint id = glGetAttribLocation(program_shader, name.c_str());
|
||||
if (id < 0)
|
||||
return id;
|
||||
if (M.size() == 0)
|
||||
{
|
||||
glDisableVertexAttribArray(id);
|
||||
return id;
|
||||
}
|
||||
glBindBuffer(GL_ARRAY_BUFFER, bufferID);
|
||||
if (refresh)
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(float)*M.size(), M.data(), GL_DYNAMIC_DRAW);
|
||||
glVertexAttribPointer(id, M.cols(), GL_FLOAT, GL_FALSE, 0, 0);
|
||||
glEnableVertexAttribArray(id);
|
||||
return id;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue