Building igl statically and moving to the dep scripts

Fixing dep build script on Windows and removing some warnings.

Use bundled igl by default.

Not building with the dependency scripts if not explicitly stated. This way, it will stay in
Fix the libigl patch to include C source files in header only mode.
This commit is contained in:
tamasmeszaros
2019-06-19 14:52:55 +02:00
parent 89e39e3895
commit 2ae2672ee9
1095 changed files with 181 additions and 5 deletions

View 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;
}