瀏覽代碼

upright glutpostredisplay, templates

Former-commit-id: 336f58f986d88c31587ddbba5fae74a92a8e635d
Alec Jacobson (jalec 11 年之前
父節點
當前提交
9552b88f01
共有 3 個文件被更改,包括 8 次插入4 次删除
  1. 4 3
      examples/rotate-widget/example.cpp
  2. 3 1
      examples/upright/example.cpp
  3. 1 0
      include/igl/matlab_format.cpp

+ 4 - 3
examples/rotate-widget/example.cpp

@@ -618,11 +618,12 @@ int main(int argc, char * argv[])
       TwEventMouseMotionGLUT(x,y);
       glutPostRedisplay();
     });
-  static std::function<void(int)> timer_dummy;
+
+  static std::function<void(int)> timer_bounce;
   auto timer = [] (int ms) {
-    timer_dummy(ms);
+    timer_bounce(ms);
   };
-  timer_dummy = [&] (int ms) {
+  timer_bounce = [&] (int ms) {
     glutTimerFunc(ms, timer, ms);
     glutPostRedisplay();
   };

+ 3 - 1
examples/upright/example.cpp

@@ -222,7 +222,6 @@ void display()
   pop_scene();
 
   glutSwapBuffers();
-  glutPostRedisplay();
 }
 
 void mouse(int glutButton, int glutState, int mouse_x, int mouse_y)
@@ -247,6 +246,7 @@ void mouse(int glutButton, int glutState, int mouse_x, int mouse_y)
       down_y = mouse_y;
     break;
   }
+  glutPostRedisplay();
 }
 
 void mouse_drag(int mouse_x, int mouse_y)
@@ -268,6 +268,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       mouse_y,
       s.rot.coeffs().data());
   }
+  glutPostRedisplay();
 }
 
 // Bake rotation and scale into V
@@ -429,6 +430,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
       cout<<"Unknown key command: '"<<key<<"' ("<<int(key)<<")"<<endl;
   }
   
+  glutPostRedisplay();
 }
 
 int main(int argc, char * argv[])

+ 1 - 0
include/igl/matlab_format.cpp

@@ -109,4 +109,5 @@ template Eigen::WithFormat<Eigen::Matrix<double, -1, 4, 0, -1, 4> > const igl::m
 template Eigen::WithFormat<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const igl::matlab_format<Eigen::Matrix<double, -1, 2, 0, -1, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >);
 template Eigen::WithFormat<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const igl::matlab_format<Eigen::Matrix<double, 2, 1, 0, 2, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >);
 template Eigen::WithFormat<Eigen::Matrix<int, 1, -1, 1, 1, -1> > const igl::matlab_format<Eigen::Matrix<int, 1, -1, 1, 1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, 1, -1, 1, 1, -1> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >);
+template Eigen::WithFormat<Eigen::Matrix<double, 1, -1, 1, 1, -1> > const igl::matlab_format<Eigen::Matrix<double, 1, -1, 1, 1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >);
 #endif