]> git.treefish.org Git - phys/latlib.git/blobdiff - culooks.cpp
...
[phys/latlib.git] / culooks.cpp
index fe8fd0076ad5cbbd7e5cb8b7ba89a04b5e822d39..8c41d236ad96aaa340629fb1e5d7bd9b5a355c44 100644 (file)
@@ -106,7 +106,7 @@ namespace mygl
       if ( culooks::Windows.at(iwin).first == glutGetWindow() ) {
        return culooks::Windows.at(iwin).second;
       }
       if ( culooks::Windows.at(iwin).first == glutGetWindow() ) {
        return culooks::Windows.at(iwin).second;
       }
-    cerr << "Something terrible happened: Could not find window-id!" << endl;
+    //cerr << "Something terrible happened: Could not find window-id!" << endl;
     exit(1);
   }
 
     exit(1);
   }
 
@@ -123,7 +123,7 @@ namespace mygl
 
   static void motionFunc(int x, int y)
   {   
 
   static void motionFunc(int x, int y)
   {   
-    cout << x << endl;
+    //cout << x << endl;
     culooks::window *Win = getWin();
    
     Win->cubes.at(rotcube[0]).az += rotcube[1] - x;
     culooks::window *Win = getWin();
    
     Win->cubes.at(rotcube[0]).az += rotcube[1] - x;
@@ -186,7 +186,7 @@ namespace mygl
 
   static void displayFunc()
   {
 
   static void displayFunc()
   {
-    cout << ":" << glutGetWindow() << endl;
+    //cout << ":" << glutGetWindow() << endl;
 
     culooks::window *Win = getWin();
     
 
     culooks::window *Win = getWin();
     
@@ -240,10 +240,8 @@ namespace mygl
        initWindow(iwin);
   }
 
        initWindow(iwin);
   }
 
-  static void* glutThread(void *_wincon)
+  static void* glutThread(void *leer)
   {
   {
-    culooks::wincontext *wincon = (culooks::wincontext *)_wincon;
-    glXMakeCurrent( wincon->gDisplay, wincon->gDrawable, wincon->gContext );
     initWindow(0);
     glutIdleFunc(&idleFunc_master);
     glutMainLoop();
     initWindow(0);
     glutIdleFunc(&idleFunc_master);
     glutMainLoop();
@@ -289,13 +287,8 @@ culooks::culooks (const char* name, const int& xcubes, const int& ycubes, const
   Windows.push_back( pair<int,culooks::window*>(0, Win) );
   
   if (windowid == 0) {
   Windows.push_back( pair<int,culooks::window*>(0, Win) );
   
   if (windowid == 0) {
-    wincon.gContext = glXGetCurrentContext();
-    wincon.gDisplay = glXGetCurrentDisplay();
-    wincon.gDrawable = glXGetCurrentDrawable();
-
     glXMakeCurrent(0,0,0);
     glXMakeCurrent(0,0,0);
-
-    pthread_create(&glThreadId, 0, &mygl::glutThread, &wincon);
+    pthread_create(&glThreadId, 0, &mygl::glutThread, NULL);
   }
 
   mywid = windowid;
   }
 
   mywid = windowid;