فهرست منبع

Merge branch 'alecjacobson' of github.com:libigl/libigl into alecjacobson

Former-commit-id: d8e8732e744eded1b3dde8df7c1052dcb9e1805a
Alec Jacobson 8 سال پیش
والد
کامیت
f067e97ad1

+ 10 - 0
include/igl/opengl/glfw/background_window.cpp

@@ -17,6 +17,16 @@ IGL_INLINE bool igl::opengl::glfw::background_window(GLFWwindow* & window)
   window = glfwCreateWindow(1, 1,"", NULL, NULL);
   window = glfwCreateWindow(1, 1,"", NULL, NULL);
   if(!window) return false;
   if(!window) return false;
   glfwMakeContextCurrent(window);
   glfwMakeContextCurrent(window);
+  #ifndef __APPLE__
+    glewExperimental = true;
+    GLenum err = glewInit();
+    if(GLEW_OK != err)
+    {
+      /* Problem: glewInit failed, something is seriously wrong. */
+     fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
+    }
+    glGetError(); // pull and savely ignonre unhandled errors like GL_INVALID_ENUM
+  #endif
   return true;
   return true;
 }
 }
 
 

+ 0 - 10
include/igl/opengl/init_render_to_texture.cpp

@@ -18,16 +18,6 @@ IGL_INLINE void igl::opengl::init_render_to_texture(
   GLuint & d_id)
   GLuint & d_id)
 {
 {
   using namespace std;
   using namespace std;
-  // Delete if already exists
-  glDeleteTextures(1,&tex_id);
-  glDeleteFramebuffers(1,&fbo_id);
-  if(depth_texture)
-  {
-    glDeleteTextures(1,&d_id);
-  }else
-  {
-    glDeleteFramebuffers(1,&d_id);
-  }
   // http://www.opengl.org/wiki/Framebuffer_Object_Examples#Quick_example.2C_render_to_texture_.282D.29
   // http://www.opengl.org/wiki/Framebuffer_Object_Examples#Quick_example.2C_render_to_texture_.282D.29
   const auto & gen_tex = [](GLuint & tex_id)
   const auto & gen_tex = [](GLuint & tex_id)
   {
   {

+ 2 - 2
optional/CMakeLists.txt

@@ -22,7 +22,7 @@ option(LIBIGL_USE_STATIC_LIBRARY "Use LibIGL as static library" ON)
 
 
 
 
 option(LIBIGL_WITH_ANTTWEAKBAR      "Use AntTweakBar"    ON)
 option(LIBIGL_WITH_ANTTWEAKBAR      "Use AntTweakBar"    ON)
-find_package(CGAL QUIET)
+find_package(CGAL QUIET COMPONENTS Core)
 option(LIBIGL_WITH_CGAL             "Use CGAL"           "${CGAL_FOUND}")
 option(LIBIGL_WITH_CGAL             "Use CGAL"           "${CGAL_FOUND}")
 option(LIBIGL_WITH_COMISO           "Use CoMiso"         ON)
 option(LIBIGL_WITH_COMISO           "Use CoMiso"         ON)
 ### Cork is off by default since it fails to build out-of-the-box on windows
 ### Cork is off by default since it fails to build out-of-the-box on windows
@@ -45,7 +45,7 @@ option(LIBIGL_WITH_VIEWER           "Use OpenGL viewer"  ON)
 option(LIBIGL_WITH_XML              "Use XML"            ON)
 option(LIBIGL_WITH_XML              "Use XML"            ON)
 
 
 if(LIBIGL_WITH_CGAL) # Do not remove or move this block, cgal strange build system fails without it
 if(LIBIGL_WITH_CGAL) # Do not remove or move this block, cgal strange build system fails without it
-  find_package(CGAL REQUIRED)
+  find_package(CGAL REQUIRED COMPONENTS Core)
   set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE CACHE BOOL "CGAL's CMAKE Setup is super annoying ")
   set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE CACHE BOOL "CGAL's CMAKE Setup is super annoying ")
   include(${CGAL_USE_FILE})
   include(${CGAL_USE_FILE})
 endif()
 endif()

+ 1 - 1
shared/cmake/CMakeLists.txt

@@ -99,7 +99,7 @@ endif()
 
 
 ### Compile the AntTweakBar part ###
 ### Compile the AntTweakBar part ###
 if(LIBIGL_WITH_ANTTWEAKBAR)
 if(LIBIGL_WITH_ANTTWEAKBAR)
-  set(ANTTWEAKBAR_DIR "${LIBIGL_EXTERNAL}/anttweakbar")
+  set(ANTTWEAKBAR_DIR "${LIBIGL_EXTERNAL}/AntTweakBar")
   set(ANTTWEAKBAR_INCLUDE_DIR "${ANTTWEAKBAR_DIR}/include")
   set(ANTTWEAKBAR_INCLUDE_DIR "${ANTTWEAKBAR_DIR}/include")
   set(ANTTWEAKBAR_C_SRC_FILES
   set(ANTTWEAKBAR_C_SRC_FILES
     "${ANTTWEAKBAR_DIR}/src/TwEventGLFW.c"
     "${ANTTWEAKBAR_DIR}/src/TwEventGLFW.c"

+ 1 - 0
shared/cmake/FindCGAL.cmake

@@ -49,6 +49,7 @@ if ( NOT CGAL_DIR )
     ${CGAL_DIR_SEARCH}
     ${CGAL_DIR_SEARCH}
 
 
     # Look in standard UNIX install locations.
     # Look in standard UNIX install locations.
+    /usr/lib/x86_64-linux-gnu/cmake/CGAL
     /opt/local/share/CGAL/cmake
     /opt/local/share/CGAL/cmake
     /usr/local/lib/CGAL
     /usr/local/lib/CGAL
     /usr/lib/CGAL
     /usr/lib/CGAL