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);
}
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;
static void displayFunc()
{
- cout << ":" << glutGetWindow() << endl;
+ //cout << ":" << glutGetWindow() << endl;
culooks::window *Win = getWin();
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();
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;