]> git.treefish.org Git - phys/latlib.git/blobdiff - culooks.cpp
...
[phys/latlib.git] / culooks.cpp
index b54eddd2394f31d7fe14309e53530d7e2b72f229..8c41d236ad96aaa340629fb1e5d7bd9b5a355c44 100644 (file)
@@ -1,5 +1,6 @@
 #include "culooks.h"
 
+#include <iostream>
 #include <math.h>
 
 vector< pair<int,culooks::window*> > culooks::Windows;
@@ -239,10 +240,8 @@ namespace mygl
        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();
@@ -288,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) {
-    wincon.gContext = glXGetCurrentContext();
-    wincon.gDisplay = glXGetCurrentDisplay();
-    wincon.gDrawable = glXGetCurrentDrawable();
-
     glXMakeCurrent(0,0,0);
-
-    pthread_create(&glThreadId, 0, &mygl::glutThread, &wincon);
+    pthread_create(&glThreadId, 0, &mygl::glutThread, NULL);
   }
 
   mywid = windowid;