浏览代码

missing igl_no_opengl s

Former-commit-id: 1837549c34cf460bf7ae97fba9df9709a9430b17
Alec Jacobson (jalec 11 年之前
父节点
当前提交
f92bae1b4f
共有 5 个文件被更改,包括 16 次插入1 次删除
  1. 2 0
      include/igl/lens_flare.cpp
  2. 2 0
      include/igl/lens_flare.h
  3. 5 1
      include/igl/sort_triangles.cpp
  4. 2 0
      include/igl/sort_triangles.h
  5. 5 0
      tutorial.html

+ 2 - 0
include/igl/lens_flare.cpp

@@ -1,5 +1,6 @@
 #include "lens_flare.h"
 
+#ifndef IGL_NO_OPENGL
 #include "C_STR.h"
 #include "unproject.h"
 #include "project.h"
@@ -186,3 +187,4 @@ void igl::lens_flare_draw(
   glDepthFunc(odf);
   glDepthMask(odwm);
 }
+#endif

+ 2 - 0
include/igl/lens_flare.h

@@ -1,6 +1,7 @@
 #ifndef IGL_LENS_FLARE_H
 #define IGL_LENS_FLARE_H
 
+#ifndef IGL_NO_OPENGL
 #include <igl/OpenGL_convenience.h>
 #include <Eigen/Core>
 
@@ -80,3 +81,4 @@ namespace igl
 #endif
 
 #endif
+#endif

+ 5 - 1
include/igl/sort_triangles.cpp

@@ -6,7 +6,6 @@
 #include "round.h"
 #include "colon.h"
 #include "matlab_format.h"
-#include "OpenGL_convenience.h"
 
 #include <iostream>
 
@@ -81,6 +80,8 @@ IGL_INLINE void igl::sort_triangles(
   slice(F,I,1,FF);
 }
 
+#ifndef IGL_NO_OPENGL
+#include "OpenGL_convenience.h"
 template <
   typename DerivedV,
   typename DerivedF,
@@ -553,10 +554,13 @@ class Triangle
 //    return sort_triangles_robust(V,F,MV,P,FF,I);
 //  }
 //}
+#endif
 
 #ifndef IGL_HEADER_ONLY
 // Explicit template instanciation
 //template void igl::sort_triangles_robust<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+#ifndef IGL_NO_OPENGL
 template void igl::sort_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 template void igl::sort_triangles_slow<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
 #endif
+#endif

+ 2 - 0
include/igl/sort_triangles.h

@@ -28,6 +28,7 @@ namespace igl
     const Eigen::PlainObjectBase<DerivedP> & P,
     Eigen::PlainObjectBase<DerivedFF> & FF,
     Eigen::PlainObjectBase<DerivedI> & I);
+#ifndef IGL_NO_OPENGL
   template <
     typename DerivedV,
     typename DerivedF,
@@ -72,6 +73,7 @@ namespace igl
   //  const Eigen::PlainObjectBase<DerivedF> & F,
   //  Eigen::PlainObjectBase<DerivedFF> & FF,
   //  Eigen::PlainObjectBase<DerivedI> & I);
+#endif
 }
 
 #ifdef IGL_HEADER_ONLY

+ 5 - 0
tutorial.html

@@ -297,6 +297,11 @@ g++ -g -I/opt/local/include/eigen3/ -I/usr/local/igl/libigl/ -L/usr/local/igl/li
 ./test path/to/mesh.obj
       </code></pre>
 
+      <p>The following bash one-liner will find all source files that contain the string <code>OpenGL</code> but don't contain and <code>IGL_NO_OPENGL</code> guard:
+      <pre><code>
+grep OpenGL `grep -L IGL_NO_OPENGL include/igl/*`
+      </code></pre>
+
       <h2 id="dependencies">Dependencies</h2>
       <p>
         By design the libigl library has very few external dependencies.