X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/2c7ea0058473eb98219ff87c64e28f31fac34b90..56501911055f24d1b06f2847c55e6d359dbd1760:/culooks.cpp?ds=inline diff --git a/culooks.cpp b/culooks.cpp index fe8fd00..8c41d23 100644 --- a/culooks.cpp +++ b/culooks.cpp @@ -106,7 +106,7 @@ namespace mygl 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); } @@ -123,7 +123,7 @@ namespace mygl 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; @@ -186,7 +186,7 @@ namespace mygl static void displayFunc() { - cout << ":" << glutGetWindow() << endl; + //cout << ":" << glutGetWindow() << endl; culooks::window *Win = getWin(); @@ -240,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(); @@ -289,13 +287,8 @@ culooks::culooks (const char* name, const int& xcubes, const int& ycubes, const Windows.push_back( pair(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;