#include "map_texture.h" #include "../create_shader_program.h" #include "../gl.h" #define GLFW_INCLUDE_GLU #include #include #include template IGL_INLINE bool igl::opengl::glfw::map_texture( const Eigen::MatrixBase & _V, const Eigen::MatrixBase & _F, const Eigen::MatrixBase & _U, const unsigned char * in_data, const int w, const int h, const int nc, std::vector & out_data) { int out_w = w; int out_h = h; int out_nc = nc; return map_texture(_V,_F,_U,in_data,w,h,nc,out_data,out_w,out_h,out_nc); } template IGL_INLINE bool igl::opengl::glfw::map_texture( const Eigen::MatrixBase & _V, const Eigen::MatrixBase & _F, const Eigen::MatrixBase & _U, const unsigned char * in_data, const int w, const int h, const int nc, std::vector & out_data, int & out_w, int & out_h, int & out_nc) { const auto fail = [](const std::string msg) { std::cerr< V = _V.template cast(); Eigen::Matrix< double, DerivedU::RowsAtCompileTime, DerivedU::ColsAtCompileTime, Eigen::RowMajor> U = _U.template cast(); Eigen::Matrix< int, DerivedF::RowsAtCompileTime, DerivedF::ColsAtCompileTime, Eigen::RowMajor> F = _F.template cast(); const int dim = U.cols(); // Set up glfw if(!glfwInit()) fail("Could not initialize glfw"); glfwSetErrorCallback([](int id,const char* m){std::cerr<, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, unsigned char const*, int, int, int, std::vector >&); #endif