mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-09-26 07:03:12 +08:00

* 1. Remove all global include_directories. * 2. Move 3d party dependencies from src to budled deps if possible. * Unify and enforce one way of including headers: e.g. #include "libslic3r/GCode.hpp" vs #include "GCode.hpp" (always use the "libslic3r/GCode.hpp" option). * Make all dependencies (also header only) a cmake target.
25 lines
702 B
C++
25 lines
702 B
C++
#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;
|
|
}
|