Browse Source

Merge pull request #8 from Victor-Savu/master

Small fixes

Former-commit-id: d3d2986d7b5bfeabaa93180c09da68043c235e7c
Alec Jacobson 11 years ago
parent
commit
8fc1fe229a

+ 3 - 0
.gitignore

@@ -1,6 +1,9 @@
 # use glob syntax.
 syntax: glob
 scripts/change_name.sh
+*.so
+*.so.[0123456789]
+*.so.[0123456789].[0123456789]
 *.o
 *.a
 *.dylib

+ 18 - 9
include/igl/viewer/Viewer.cpp

@@ -76,6 +76,13 @@ static double highdpi = 1;
 static double scroll_x = 0;
 static double scroll_y = 0;
 
+namespace {
+void TW_CALL copy_str(std::string& dst, const std::string& src)
+{
+  dst = src;
+}
+}
+
 static void glfw_mouse_press(GLFWwindow* window, int button, int action, int modifier)
 {
   bool tw_used = TwEventMouseButtonGLFW(button, action);
@@ -904,17 +911,17 @@ namespace igl
       return EXIT_FAILURE;
     }
 
-	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));
-	}
-	fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
+  glewExperimental = true;
+  GLenum err = glewInit();
+  if (GLEW_OK != err)
+  {
+    /* Problem: glewInit failed, something is seriously wrong. */
+    fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
+  }
+  fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
 #endif
 
     #ifdef DEBUG
@@ -931,6 +938,8 @@ namespace igl
 
     // Initialize AntTweakBar
     TwInit(TW_OPENGL_CORE, NULL);
+    TwCopyStdStringToClientFunc(static_cast<TwCopyStdStringToClient>(::copy_str));
+
 
     // Initialize IGL viewer
     init();

+ 3 - 5
include/igl/viewer/ViewerPlugin.h

@@ -8,7 +8,7 @@
 
 #ifndef IGL_VIEWER_PLUGIN_H
 #define IGL_VIEWER_PLUGIN_H
-
+#include <string>
 #include <igl/igl_inline.h>
 
 #ifdef ENABLE_XML_SERIALIZATION
@@ -39,9 +39,9 @@ public:
   #ifdef ENABLE_XML_SERIALIZATION
   : XMLSerialization("dummy")
   #endif
-  {plugin_name = "dummy";};
+  {plugin_name = "dummy";}
 
-  ~ViewerPlugin(){};
+  virtual ~ViewerPlugin(){}
 
   // This function is called when the viewer is initialized (no mesh will be loaded at this stage)
   IGL_INLINE virtual void init(igl::Viewer *_viewer)
@@ -132,8 +132,6 @@ public:
 protected:
   // Pointer to the main Preview3D class
   Viewer *viewer;
-public:
-    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 };
 
 }

+ 1 - 1
include/igl/xml/XMLSerializer.h.REMOVED.git-id

@@ -1 +1 @@
-8732db96cb04680209315d0fd383a4e392159b2e
+ab26d135c79d225b587e9dd8a7cb86a677edcb82

+ 1 - 1
tutorial/607_Picking/main.cpp

@@ -27,7 +27,7 @@ bool mouse_down(igl::Viewer& viewer, int button, int modifier)
   // Cast a ray in the view direction starting from the mouse position
   double x = viewer.current_mouse_x;
   double y = viewer.core.viewport(3) - viewer.current_mouse_y;
-  bool hit = unproject_onto_mesh(Vector2f(x,y),
+  bool hit = igl::unproject_onto_mesh(Vector2f(x,y),
                                 F,
                                 viewer.core.view * viewer.core.model,
                                 viewer.core.proj,