Skip to content
Snippets Groups Projects
Commit b6722b83 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix crash on mac

parent 375a0cad
No related branches found
No related tags found
No related merge requests found
...@@ -427,6 +427,9 @@ int main(int argc, char **argv) ...@@ -427,6 +427,9 @@ int main(int argc, char **argv)
} }
for(int i = 1; i < argc; i++) GmshMergeFile(argv[i]); for(int i = 1; i < argc; i++) GmshMergeFile(argv[i]);
camera.lookAtCg();
ctx = new drawContext(); ctx = new drawContext();
drawContext::setGlobal(new drawContextGlut); drawContext::setGlobal(new drawContextGlut);
...@@ -438,14 +441,11 @@ int main(int argc, char **argv) ...@@ -438,14 +441,11 @@ int main(int argc, char **argv)
else { else {
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH ); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );
} }
glutDisplayFunc(display);
glutInitWindowSize(ctx->viewport[2], ctx->viewport[3]); glutInitWindowSize(ctx->viewport[2], ctx->viewport[3]);
glutInitWindowPosition(400,10); glutInitWindowPosition(400,10);
glutInitWindowSize(800,800); glutInitWindowSize(800,800);
glutCreateWindow("GLUT Gmsh Viewer"); glutCreateWindow("GLUT Gmsh Viewer");
glutDisplayFunc(display);
camera.lookAtCg();
glutReshapeFunc(reshape); glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard); glutKeyboardFunc(keyboard);
glutMotionFunc(motion); glutMotionFunc(motion);
...@@ -453,7 +453,6 @@ int main(int argc, char **argv) ...@@ -453,7 +453,6 @@ int main(int argc, char **argv)
glutKeyboardFunc(processNormalKeys); glutKeyboardFunc(processNormalKeys);
glutSpecialFunc(processSpecialKeys); glutSpecialFunc(processSpecialKeys);
cout<<"-------------------------------------"<<endl; cout<<"-------------------------------------"<<endl;
cout<<" SHORTCUTS "<<endl; cout<<" SHORTCUTS "<<endl;
cout<<"-------------------------------------"<<endl; cout<<"-------------------------------------"<<endl;
...@@ -480,6 +479,3 @@ int main(int argc, char **argv) ...@@ -480,6 +479,3 @@ int main(int argc, char **argv)
GmshFinalize(); GmshFinalize();
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment