Procházet zdrojové kódy

added cgal as submodule
glew for linux (until find solution)


Former-commit-id: 6bd7b75b72ba89e269065aae2070a477521918d9

Romain Prévost před 9 roky
rodič
revize
1ef9b699bd

+ 3 - 0
.gitmodules

@@ -18,3 +18,6 @@ url=https://github.com/libigl/nanogui.git
 [submodule "external/tinyxml2"]
 	path = external/tinyxml2
 	url = https://github.com/leethomason/tinyxml2.git
+[submodule "external/cgal"]
+	path = external/cgal
+	url = https://github.com/CGAL/cgal.git

+ 1 - 2
cmake/CMakeLists.txt

@@ -257,8 +257,7 @@ if(LIBIGL_WITH_VIEWER) # to finish cleaning
   list(APPEND LIBIGL_INCLUDE_DIRS ${NANOGUI_INCLUDE_DIRS})
   list(APPEND LIBIGL_EXTRA_LIBRARIES "nanogui" "glfw" ${GLFW_LIBRARIES} pthread)
 
-  # GLEW: this should be cleaned and tested
-  if(WIN32 OR UNIX)
+  if(WIN32 OR UNIX) # GLEW should not be needed on Linux
     include_directories("${NANOGUI_DIR}/ext/glew/include")
     list(APPEND LIBIGL_INCLUDE_DIRS "${NANOGUI_DIR}/ext/glew/include")
     list(APPEND LIBIGL_EXTRA_SOURCES "${NANOGUI_DIR}/ext/glew/src/glew.c")

+ 4 - 1
include/igl/opengl/OpenGL_convenience.h

@@ -38,12 +38,15 @@
     #define GLEW_STATIC
     #include <GL/glew.h>
 #else
+    /* glew should not be needed on Linux, and is not included by Nanogui,
+     * but removing it creates problems, and the GUI disappears
+     */
     #define GLEW_STATIC
     #include <GL/glew.h>
+
     #define GL_GLEXT_PROTOTYPES
 #endif
 
-//#define GLFW_INCLUDE_GLU
 #include <GLFW/glfw3.h>
 
 #endif

+ 0 - 14
include/igl/viewer/OpenGL_shader.h

@@ -20,20 +20,6 @@
 #  undef DrawText
 #endif
 
-/*#ifndef __APPLE__
-#  define GLEW_STATIC
-#  include <GL/glew.h>
-#endif
-
-#ifdef __APPLE__
-#   include <OpenGL/gl3.h>
-#   define __gl_h_ // Prevent inclusion of the old gl.h
-#else
-#   ifdef _WIN32
-#       include <windows.h>
-#   endif
-#   include <GL/gl.h>
-#endif*/
 #include "../opengl/OpenGL_convenience.h"
 
 namespace igl

+ 3 - 21
include/igl/viewer/Viewer.cpp

@@ -17,26 +17,8 @@
 #include <chrono>
 #include <thread>
 
-/*#ifndef __APPLE__
-#  define GLEW_STATIC
-#  include <GL/glew.h>
-#endif
-
-#ifdef __APPLE__
-#   include <OpenGL/gl3.h>
-#   define __gl_h_ // Prevent inclusion of the old gl.h
-#else
-#   include <GL/gl.h>
-#endif*/
-
 #include "../opengl/OpenGL_convenience.h"
 
-/*#define GLFW_INCLUDE_GLU
-#ifndef _WIN32
-  #define GLFW_INCLUDE_GLCOREARB
-#endif
-#include <GLFW/glfw3.h>*/
-
 #include <Eigen/LU>
 
 
@@ -742,10 +724,10 @@ namespace viewer
     glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
     glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
 
-    #ifdef __APPLE__
+//    #ifdef __APPLE__
       glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
       glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
-    #endif
+//    #endif
 
     if(fullscreen)
     {
@@ -766,7 +748,7 @@ namespace viewer
 
     glfwMakeContextCurrent(window);
 
-    #ifndef __APPLE__
+    #ifndef __APPLE__ // this should only be needed for Windows
       glewExperimental = true;
       GLenum err = glewInit();
       if(GLEW_OK != err)