Merge branch 'alecjacobson' of github.com:libigl/libigl into alecjacobson
This commit is contained in:
Vendored
+22
-21
@@ -44,7 +44,28 @@
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#if defined(_UNIX)
|
||||
#if defined(_WINDOWS) || defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64)
|
||||
# define ANT_WINDOWS
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <shellapi.h>
|
||||
#elif defined(_MACOSX)
|
||||
# define ANT_OSX
|
||||
# include <unistd.h>
|
||||
# include <Foundation/Foundation.h>
|
||||
# include <AppKit/NSImage.h>
|
||||
# include <AppKit/NSCursor.h>
|
||||
# undef _WIN32
|
||||
# undef WIN32
|
||||
# undef _WIN64
|
||||
# undef WIN64
|
||||
# undef _WINDOWS
|
||||
# undef ANT_WINDOWS
|
||||
# undef ANT_UNIX
|
||||
#else
|
||||
//defined(_UNIX)
|
||||
# define ANT_UNIX
|
||||
# include <X11/cursorfont.h>
|
||||
# define GLX_GLXEXT_LEGACY
|
||||
@@ -59,26 +80,6 @@
|
||||
# undef _WINDOWS
|
||||
# undef ANT_WINDOWS
|
||||
# undef ANT_OSX
|
||||
#elif defined(_MACOSX)
|
||||
# define ANT_OSX
|
||||
# include <unistd.h>
|
||||
# include <Foundation/Foundation.h>
|
||||
# include <AppKit/NSImage.h>
|
||||
# include <AppKit/NSCursor.h>
|
||||
# undef _WIN32
|
||||
# undef WIN32
|
||||
# undef _WIN64
|
||||
# undef WIN64
|
||||
# undef _WINDOWS
|
||||
# undef ANT_WINDOWS
|
||||
# undef ANT_UNIX
|
||||
#elif defined(_WINDOWS) || defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64)
|
||||
# define ANT_WINDOWS
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <shellapi.h>
|
||||
#endif
|
||||
|
||||
#if !defined(ANT_OGL_HEADER_INCLUDED)
|
||||
|
||||
@@ -17,6 +17,16 @@ IGL_INLINE bool igl::opengl::glfw::background_window(GLFWwindow* & window)
|
||||
window = glfwCreateWindow(1, 1,"", NULL, NULL);
|
||||
if(!window) return false;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,16 +18,6 @@ IGL_INLINE void igl::opengl::init_render_to_texture(
|
||||
GLuint & d_id)
|
||||
{
|
||||
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
|
||||
const auto & gen_tex = [](GLuint & tex_id)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ option(LIBIGL_USE_STATIC_LIBRARY "Use LibIGL as static library" 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_COMISO "Use CoMiso" ON)
|
||||
### 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)
|
||||
|
||||
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 ")
|
||||
include(${CGAL_USE_FILE})
|
||||
endif()
|
||||
|
||||
@@ -99,7 +99,7 @@ endif()
|
||||
|
||||
### Compile the AntTweakBar part ###
|
||||
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_C_SRC_FILES
|
||||
"${ANTTWEAKBAR_DIR}/src/TwEventGLFW.c"
|
||||
|
||||
@@ -49,6 +49,7 @@ if ( NOT CGAL_DIR )
|
||||
${CGAL_DIR_SEARCH}
|
||||
|
||||
# Look in standard UNIX install locations.
|
||||
/usr/lib/x86_64-linux-gnu/cmake/CGAL
|
||||
/opt/local/share/CGAL/cmake
|
||||
/usr/local/lib/CGAL
|
||||
/usr/lib/CGAL
|
||||
|
||||
Reference in New Issue
Block a user