Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ContextGLUT.cpp
1 #include "ContextGLUT.hh"
2 #include <bias_config.h>
3 #include <Gui/biasgl.h>
4 #include <iostream>
5 #include <vector>
6 #include <Utils/GlewInitWrapper.hh>
7 #include <Utils/GlutInitWrapper.hh>
8 
9 #ifdef GLUT_TIME_MEASURE
10 #include <Base/Debug/TimeMeasure.hh>
11 BIAS::TimeMeasure timeMeasure_;
12 unsigned int timeMeasureCount_ = 0;
13 unsigned int outputCount_ = 0;
14 unsigned int outputIntervall = 1;
15 unsigned int MEASURE_INTERVALL = 1;
16 unsigned int BIAS::ContextGLUT::measurementsCount_ = 0;
17 std::vector<double> BIAS::ContextGLUT::fpsMeasures;
18 #endif
19 
20 
21 using namespace std;
22 using namespace BIAS;
23 
24 ContextGLUT* RegisteredContext;
25 std::vector<ContextGLUT*> registeredGlutWindows;
26 
27 void SetRegisteredContext() {
28  RegisteredContext = NULL;
29  for(unsigned int i=0; i<registeredGlutWindows.size(); i++) {
30  if(registeredGlutWindows[i]->GetGlutWindowID()==glutGetWindow()) {
31  RegisteredContext = registeredGlutWindows[i];
32  // cout<<"setting new registered context to id "
33  // <<registeredGlutWindows[i]->GetGlutWindowID()<<endl;
34  }
35  }
36 }
37 
38 /** Grouping the mouseactions reported by GLUT.
39  */
40 struct MouseActionStruct
41 {
42  int lastLeftX, lastLeftY;
43  int lastRightX, lastRightY;
44  int lastMiddleX, lastMiddleY;
45  time_t lastTimeLeft;
46  bool leftDown;
47  bool rightDown;
48  bool middleDown;
49  //double / single clicks
50  bool listeningForLeftDoubleClick;
51  bool receivedLeftDoubleClick;
52  bool leftButtonWasUp;
53  bool listeningForRightDoubleClick;
54  bool receivedRightDoubleClick;
55  bool rightButtonWasUp;
56 } MouseAction;
57 
58 #define DOUBLE_CLICK_MS 200
59 
60 void BIAS::MouseMotionFunc_(int x, int y)
61 {
62 
63  SetRegisteredContext();
64  //store if first clicked
65  if(RegisteredContext->control_==NULL) {
66  // BIASERR("No control has been set\n");
67  return;
68  }
69 
70  if(!(MouseAction.leftDown && MouseAction.rightDown)) {
71  if(MouseAction.leftDown) {
72  RegisteredContext->LeftMouseMoved(MouseAction.lastLeftX, x,
73  MouseAction.lastLeftY, y);
74  MouseAction.lastLeftX=x;
75  MouseAction.lastLeftY=y;
76  }
77  if(MouseAction.rightDown) {
78 
79  RegisteredContext->RightMouseMoved(MouseAction.lastRightX, x,
80  MouseAction.lastRightY, y);
81  MouseAction.lastRightX=x;
82  MouseAction.lastRightY=y;
83  }
84  } else {
85  RegisteredContext->LeftAndRightMouseMoved(MouseAction.lastRightX, x,
86  MouseAction.lastRightY, y);
87  MouseAction.lastLeftX=x;
88  MouseAction.lastLeftY=y;
89  MouseAction.lastRightX=x;
90  MouseAction.lastRightY=y;
91  }
92 
93  if(MouseAction.middleDown) {
94  RegisteredContext->MiddleMouseMoved(MouseAction.lastMiddleX, x,
95  MouseAction.lastMiddleY, y);
96  MouseAction.lastMiddleX=x;
97  MouseAction.lastMiddleY=y;
98  }
99  RegisteredContext->MouseMoved(x,y);
100  glutPostRedisplay();
101 }
102 
104 {
105 
106  SetRegisteredContext();
107  //store if first clicked
108  if(RegisteredContext->control_==NULL) {
109  // BIASERR("No control has been set\n");
110  return;
111  }
112 
113  RegisteredContext->MouseMoved(x,y);
114  glutPostRedisplay();
115 }
116 
117 /* Some explanations to double click implementation:
118  *
119  * MouseButtonFunc_ activates the doubleClckListener for a double click if
120  * not already activated. This is determined via global variable
121  * listeningForDoubleClick. This function is activated after DOUBLE_CLICK_MS
122  * milliseconds and turns of the double click waiting state i.e.
123  * listeningForDoubleClick = false. And checks whether the mouse button was
124  * raised. If this was the case a single button click was activated.
125  * If a double clicked was received in the meanwhile: receivedDoubleClick
126  * this is ignored.
127  *
128  */
129 
130 
131 void leftDoubleClickListener(int) {
132  MouseAction.listeningForLeftDoubleClick = false;
133  if(MouseAction.receivedLeftDoubleClick)
134  return;
135  else {
136  //not received double click was button released in between ?
137  if(!MouseAction.leftButtonWasUp)
138  return;
139  else {
140  RegisteredContext->LeftMouseSingleClicked(MouseAction.lastLeftX,
141  MouseAction.lastLeftY);
142  glutPostRedisplay();
143  }
144  }
145 }
146 
147 void rightDoubleClickListener(int) {
148  MouseAction.listeningForRightDoubleClick = false;
149  if(MouseAction.receivedRightDoubleClick)
150  return;
151  else {
152  //not received double click was button released in between ?
153  if(!MouseAction.rightButtonWasUp)
154  return;
155  else {
156  RegisteredContext->RightMouseSingleClicked(MouseAction.lastRightX,
157  MouseAction.lastRightY);
158  glutPostRedisplay();
159  }
160  }
161 }
162 
163 
164 void BIAS::MouseButtonFunc_(int button, int state, int x, int y)
165 {
166  SetRegisteredContext();
167  switch(button)
168  {
169  case GLUT_LEFT_BUTTON :
170  switch(state)
171  {
172  case GLUT_DOWN :
173  {
174  if(!MouseAction.listeningForLeftDoubleClick) {
175  MouseAction.leftDown = true;
176  MouseAction.lastLeftX = x;
177  MouseAction.lastLeftY = y;
178  MouseAction.receivedLeftDoubleClick = false;
179  MouseAction.leftButtonWasUp = false;
180  MouseAction.listeningForLeftDoubleClick = true;
181  glutTimerFunc(RegisteredContext->doubleClickInterval_,
182  leftDoubleClickListener, 0);
183  }
184  else {
185  MouseAction.receivedLeftDoubleClick = true;
186  int xDiff = MouseAction.lastLeftX - x;
187  int yDiff = MouseAction.lastLeftY - y;
188  if(xDiff == 0 && yDiff == 0) {
189  //cout<<"double click at ("<<x<<", "<<y<<")"<<endl;
190  RegisteredContext->LeftMouseDoubleClicked(x,y,0);
191  glutPostRedisplay();
192  return;
193  }
194  }
195  RegisteredContext->LeftMouseDown(x,y);
196  }
197  break;
198  case GLUT_UP :
199  {
200  MouseAction.leftButtonWasUp = true;
201  MouseAction.leftDown = false;
202  RegisteredContext->LeftMouseUp(x,y);
203  }
204  break;
205  }
206  break;
207 
208  case GLUT_RIGHT_BUTTON :
209  switch(state)
210  {
211  case GLUT_DOWN :
212  {
213  if(!MouseAction.listeningForRightDoubleClick) {
214  MouseAction.rightDown = true;
215  MouseAction.lastRightX = x;
216  MouseAction.lastRightY = y;
217  MouseAction.receivedRightDoubleClick = false;
218  MouseAction.rightButtonWasUp = false;
219  MouseAction.listeningForRightDoubleClick = true;
220  glutTimerFunc(RegisteredContext->doubleClickInterval_,
221  rightDoubleClickListener, 0);
222  }
223  else {
224  MouseAction.receivedRightDoubleClick = true;
225  int xDiff = MouseAction.lastRightX - x;
226  int yDiff = MouseAction.lastRightY - y;
227  if(xDiff == 0 && yDiff == 0) {
228  RegisteredContext->RightMouseDoubleClicked(x,y);
229  glutPostRedisplay();
230  return;
231  }
232  }
233 
234  }
235  break;
236  case GLUT_UP :
237  {
238  MouseAction.rightButtonWasUp = true;
239  MouseAction.rightDown = false;
240  }
241  break;
242  }
243  break;
244 
245  case GLUT_MIDDLE_BUTTON :
246  switch(state)
247  {
248  case GLUT_DOWN :
249  MouseAction.lastMiddleX = x;
250  MouseAction.lastMiddleY = y;
251  MouseAction.middleDown = true;
252  break;
253  case GLUT_UP : MouseAction.middleDown = false; break;
254  }
255 
256  break;
257  }
258 }
259 
260 
261 void BIAS::StandardKeyFunc_(unsigned char key, int x, int y)
262 {
263  SetRegisteredContext();
264  RegisteredContext->StandardKeyPressed(key, x, y);
265  glutPostRedisplay();
266 }
267 
268 
269 void BIAS::StandardKeyUpFunc_(unsigned char key, int x, int y)
270 {
271  SetRegisteredContext();
272  RegisteredContext->StandardKeyUp(key, x, y);
273  glutPostRedisplay();
274 }
275 
276 void BIAS::SpecialKeyFunc_(int key, int /*x*/, int /*y*/)
277 {
278  SetRegisteredContext();
279  switch(key)
280  {
281  case GLUT_KEY_F1:
282  RegisteredContext->SpecialKeyPressed(KEY_F1);
283  break;
284  case GLUT_KEY_F2:
285  RegisteredContext->SpecialKeyPressed(KEY_F2);
286  break;
287  case GLUT_KEY_F3:
288  RegisteredContext->SpecialKeyPressed(KEY_F3);
289  break;
290  case GLUT_KEY_F4:
291  RegisteredContext->SpecialKeyPressed(KEY_F4);
292  break;
293  case GLUT_KEY_F5:
294  RegisteredContext->SpecialKeyPressed(KEY_F5);
295  break;
296  case GLUT_KEY_F6:
297  RegisteredContext->SpecialKeyPressed(KEY_F6);
298  break;
299  case GLUT_KEY_F7:
300  RegisteredContext->SpecialKeyPressed(KEY_F7);
301  break;
302  case GLUT_KEY_F8:
303  RegisteredContext->SpecialKeyPressed(KEY_F8);
304  break;
305  case GLUT_KEY_F9:
306  RegisteredContext->SpecialKeyPressed(KEY_F9);
307  break;
308  case GLUT_KEY_F10:
309  RegisteredContext->SpecialKeyPressed(KEY_F10);
310  break;
311  case GLUT_KEY_F11:
312  RegisteredContext->SpecialKeyPressed(KEY_F11);
313  break;
314  case GLUT_KEY_F12:
315  RegisteredContext->SpecialKeyPressed(KEY_F12);
316  break;
317  case GLUT_KEY_HOME:
318  RegisteredContext->SpecialKeyPressed(KEY_HOME);
319  break;
320  case GLUT_KEY_PAGE_UP:
321  RegisteredContext->SpecialKeyPressed(KEY_PGUP);
322  break;
323  case GLUT_KEY_PAGE_DOWN:
324  RegisteredContext->SpecialKeyPressed(KEY_PGDOWN);
325  break;
326  case GLUT_KEY_UP:
327  RegisteredContext->SpecialKeyPressed(KEY_UP);
328  break;
329  case GLUT_KEY_DOWN:
330  RegisteredContext->SpecialKeyPressed(KEY_DOWN);
331  break;
332  case GLUT_KEY_LEFT:
333  RegisteredContext->SpecialKeyPressed(KEY_LEFT);
334  break;
335  case GLUT_KEY_RIGHT:
336  RegisteredContext->SpecialKeyPressed(KEY_RIGHT);
337  break;
338  }
339  glutPostRedisplay();
340  return;
341 }
342 
343 
344 void BIAS::SpecialKeyUpFunc_(int key, int /*x*/, int /*y*/)
345 {
346  SetRegisteredContext();
347  switch(key)
348  {
349  case GLUT_KEY_F1:
350  RegisteredContext->SpecialKeyUp(KEY_F1);
351  break;
352  case GLUT_KEY_F2:
353  RegisteredContext->SpecialKeyUp(KEY_F2);
354  break;
355  case GLUT_KEY_F3:
356  RegisteredContext->SpecialKeyUp(KEY_F3);
357  break;
358  case GLUT_KEY_F4:
359  RegisteredContext->SpecialKeyUp(KEY_F4);
360  break;
361  case GLUT_KEY_F5:
362  RegisteredContext->SpecialKeyUp(KEY_F5);
363  break;
364  case GLUT_KEY_F6:
365  RegisteredContext->SpecialKeyUp(KEY_F6);
366  break;
367  case GLUT_KEY_F7:
368  RegisteredContext->SpecialKeyUp(KEY_F7);
369  break;
370  case GLUT_KEY_F8:
371  RegisteredContext->SpecialKeyUp(KEY_F8);
372  break;
373  case GLUT_KEY_F9:
374  RegisteredContext->SpecialKeyUp(KEY_F9);
375  break;
376  case GLUT_KEY_F10:
377  RegisteredContext->SpecialKeyUp(KEY_F10);
378  break;
379  case GLUT_KEY_F11:
380  RegisteredContext->SpecialKeyUp(KEY_F11);
381  break;
382  case GLUT_KEY_F12:
383  RegisteredContext->SpecialKeyUp(KEY_F12);
384  break;
385  case GLUT_KEY_HOME:
386  RegisteredContext->SpecialKeyUp(KEY_HOME);
387  break;
388  case GLUT_KEY_PAGE_UP:
389  RegisteredContext->SpecialKeyUp(KEY_PGUP);
390  break;
391  case GLUT_KEY_PAGE_DOWN:
392  RegisteredContext->SpecialKeyUp(KEY_PGDOWN);
393  break;
394  case GLUT_KEY_UP:
395  RegisteredContext->SpecialKeyUp(KEY_UP);
396  break;
397  case GLUT_KEY_DOWN:
398  RegisteredContext->SpecialKeyUp(KEY_DOWN);
399  break;
400  case GLUT_KEY_LEFT:
401  RegisteredContext->SpecialKeyUp(KEY_LEFT);
402  break;
403  case GLUT_KEY_RIGHT:
404  RegisteredContext->SpecialKeyUp(KEY_RIGHT);
405  break;
406  }
407  glutPostRedisplay();
408  return;
409 }
410 
411 
412 void BIAS::Reshape_(int width, int height)
413 {
414  SetRegisteredContext();
415  RegisteredContext->WindowReshape(width, height);
416 }
417 
419 {
420  SetRegisteredContext();
421 #ifdef GLUT_TIME_MEASURE
422  timeMeasure_.Start();
423 #endif
424 
425  // cout<<"rendering for win"<<RegisteredContext->GetGlutWindowID()<<" /"<<glutGetWindow()<<endl;
426  RegisteredContext->Render();
427 
428 #ifdef GLUT_TIME_MEASURE
429  timeMeasure_.Stop();
430  timeMeasureCount_++;
431  if(timeMeasureCount_ > MEASURE_INTERVALL) {
432  double fps = double(timeMeasureCount_*1000)/timeMeasure_.GetUserTime();
433  if(ContextGLUT::measurementsCount_<ContextGLUT::fpsMeasures.size())
434  ContextGLUT::fpsMeasures[BIAS::ContextGLUT::measurementsCount_++] = fps;
435  outputCount_ ++;
436  if(outputCount_ == outputIntervall) {
437  stringstream fpsString;
438  fpsString<<"user time: "<<fps<<"fps";
439  glutSetWindowTitle(fpsString.str().c_str());
440  outputCount_ = 0;
441  if(fps>100) outputIntervall = (unsigned int) (fps/50.0);
442  else {
443  outputIntervall = 1;
444  }
445  }
446  timeMeasureCount_ = 0;
447  timeMeasure_.Reset();
448  }
449 #endif
450  glutSwapBuffers();
451 }
452 
454 {
455  if(RegisteredContext->TimerExpired())
456  RegisteredContext->Redisplay();
457 }
458 
459 
460 ContextGLUT::
461 ContextGLUT(int x0, int y0, int width, int height,
462  const std::string& name,
463  const char* initDisplayString,
464  int* commandLineArgc,
465  char** commandLineArgv)
467 {
468  RegisteredContext = this;
469  registeredGlutWindows.push_back(this);
470  registrationIterator_ = registeredGlutWindows.end()-1;
471 
472  doubleClickInterval_ = 180;
473  windowID_ = -1;
474  if(registeredGlutWindows.size() == 1)
475  InitContext_(initDisplayString,
476  commandLineArgc,
477  commandLineArgv);
478  CreateWindow_(x0, y0, width, height, name);
479 }
480 
482 ContextGLUT(std::string gamemodestring,
483  const std::string& name,
484  const char* initDisplayString,
485  int* commandLineArgc,
486  char** commandLineArgv)
488 {
489  if (gamemodestring.size()==0)
490  gamemodestring = "1024x768:32";
491 
492  RegisteredContext = this;
493  registeredGlutWindows.push_back(this);
494  registrationIterator_ = registeredGlutWindows.end()-1;
495 
496  doubleClickInterval_ = 180;
497  windowID_ = -1;
498  if(registeredGlutWindows.size() == 1)
499  InitContext_(initDisplayString,
500  commandLineArgc,
501  commandLineArgv);
502  EnterGameMode_(gamemodestring);
503 }
504 
507 {
508  DestroyWindow_();
509  RegisteredContext = NULL;
510 }
511 
512 
513 void ContextGLUT::
515 {
516  glutSetWindow(windowID_);
517  glutReshapeFunc(Reshape_);
518  glutMotionFunc(MouseMotionFunc_);
519  glutPassiveMotionFunc(MousePassiveMotionFunc_);
520  glutMouseFunc(MouseButtonFunc_);
521  glutSpecialFunc(SpecialKeyFunc_);
522  glutSpecialUpFunc(SpecialKeyUpFunc_);
523  glutKeyboardFunc(StandardKeyFunc_);
524  glutKeyboardUpFunc(StandardKeyUpFunc_);
525  glutDisplayFunc(&Render_);
526  glutIdleFunc(&WhenIdle_);
527 }
528 
529 void ContextGLUT::
530 InitContext_(const char* initDisplayString,
531  int* commandLineArgc,
532  char** commandLineArgv)
533 {
534  if(commandLineArgc == NULL || commandLineArgv == NULL) {
536  } else
537  BIAS::GlutInitWrapper::GetInstance()->Init(*commandLineArgc,commandLineArgv);
538 
539  if (initDisplayString == NULL) {
540  //string displayString = "double rgba alpha depth";
541  //glutInitDisplayString(displayString.c_str());
542  glutInitDisplayMode(GLUT_DOUBLE
543  | GLUT_RGBA
544  | GLUT_DEPTH
545  | GLUT_ALPHA
546  | GLUT_STENCIL
547  );
548  } else
549  glutInitDisplayString(initDisplayString);
550 }
551 
552 
553 void ContextGLUT::
554 CreateWindow_(int x0, int y0, int width, int height,
555  const std::string& name)
556 {
557  if(windowID_ != -1) {
558  BIASERR("ContextGLUT can only keep track of single window\n");
559  return;
560  }
561  glutInitWindowPosition(x0, y0);
562  glutInitWindowSize(width, height);
563  windowID_ = glutCreateWindow(name.c_str());
565 
567  gameMode_ = false;
568 }
569 
570 
571 
572 void ContextGLUT::
574 {
575  if(windowID_ != -1) {
576  if (gameMode_) {
577  if (glutGameModeGet(GLUT_GAME_MODE_ACTIVE) != 0)
578  glutLeaveGameMode();
579  } else {
580  glutDestroyWindow(windowID_);
581  registeredGlutWindows.erase(registrationIterator_);
582  windowID_ = -1 ;
583  }
584  }
585 }
586 
587 void ContextGLUT::
589 {
590  if(windowID_ != -1) {
591  glutSetWindow(windowID_);
592 
593  RegisteredContext = this;//needed?
594  }
595 }
596 
597 void ContextGLUT::
599 {
600  // glutSetWindow(windowID_);
601  // glutPostRedisplay();
602 
603  if (gameMode_) {
604  glutPostRedisplay();
605  } else {
606  glutPostWindowRedisplay(windowID_);
607  }
608 }
609 
610 bool active = false;
611 bool first = true;
612 void oneShotTimer(int interval)
613 {
614  // cout<<"oneShotTimer..."<<endl;
615  if(RegisteredContext->TimerExpired()) {
616  // cout<<"TimerExpired"<<endl;
617  RegisteredContext->Redisplay();
618  }
619  RegisteredContext->SetTimer(interval);
620 }
621 
622 void ContextGLUT::
623 SetTimer(unsigned int interval)
624 {
625  if(first)
626  active = true; //activated if SetTimer is called for the first time
627  if(!first && !active) {
628  first = true; //when deactivating next call to SetTimer will be the first?!
629  return;//jumps out if not active!
630  }
631  glutTimerFunc(interval, &oneShotTimer, interval);
632  // cout<<"after calling one shot!\n";
633  first = false;
634 }
635 
636 void ContextGLUT::
638 {
639  active = false;
640 }
641 
642 void ContextGLUT::
643 EnterGameMode_(const string gamemodestring) {
644  if(windowID_ != -1) {
645  BIASERR("ContextGLUT can only keep track of single window\n");
646  return;
647  }
648  glutGameModeString(gamemodestring.c_str());
649  if (glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) {
650  BIASWARN("entering glut gamemode");
651  glutEnterGameMode();
652  windowID_ = glutGetWindow();
654  } else {
655  BIASERR("Full Screen Mode not available: " << gamemodestring);
656  BIASABORT;
657  }
658 
660  gameMode_ = true;
661 }
virtual void InitContext_(const char *initDisplayString=NULL, int *commandLineArgc=NULL, char **commandLineArgv=NULL)
Initialization of glut library, initial display state and registration of callbacks.
bool LeftMouseDoubleClicked(int x, int y, int m)
bool LeftMouseSingleClicked(int x, int y)
friend void WhenIdle_()
ContextGLUT(int x0=0, int y0=0, int width=400, int height=600, const std::string &name="ContextGLUT Window", const char *initDisplayString=NULL, int *commandLineArgc=NULL, char **commandLineArgv=NULL)
void RegisterCallbacks_() const
void WhenIdle_()
virtual void CreateWindow_(int x0, int y0, int width, int height, const std::string &name)
Creates a glut window and registers all known callbacks to it.
bool StandardKeyUp(unsigned char, int, int)
unsigned int doubleClickInterval_
Definition: ContextGLUT.hh:111
bool RightMouseDoubleClicked(int x, int y)
virtual void Redisplay()
Demands a rendering from the Context;.
void Reshape_(int width, int height)
bool LeftMouseDown(int x, int y)
virtual int Render()
Simple rendering routine.
bool LeftMouseMoved(int x1, int x2, int y1, int y2)
bool TimerExpired()
Always informs both camera and scenes!
ControlInterface * control_
friend void Reshape_(int width, int height)
void SpecialKeyFunc_(int key, int x, int y)
static GlutInitWrapper * GetInstance()
virtual ~ContextGLUT()
void Render_()
bool StandardKeyPressed(unsigned char, int, int)
friend void StandardKeyFunc_(unsigned char key, int x, int y)
friend void MouseButtonFunc_(int button, int state, int x, int y)
friend void SpecialKeyFunc_(int key, int x, int y)
friend void Render_()
virtual void SetTimer(unsigned int interval)
activate timer with intervall in ms
bool RightMouseSingleClicked(int x, int y)
bool LeftMouseUp(int x, int y)
virtual void DeactivateTimer()
deactivate timer
virtual void MakeGLContextCurrent()
try to make this OpenGl context current
void EnterGameMode_(const std::string gamemodestring)
bool LeftAndRightMouseMoved(int x1, int x2, int y1, int y2)
Wrapper to glut-library.
Definition: ContextGLUT.hh:38
virtual void DestroyWindow_()
friend void MouseMotionFunc_(int x, int y)
void StandardKeyFunc_(unsigned char key, int x, int y)
bool WindowReshape(int width, int height)
void SpecialKeyUpFunc_(int key, int x, int y)
bool MiddleMouseMoved(int x1, int x2, int y1, int y2)
bool MouseMoved(int x, int y)
void MouseButtonFunc_(int button, int state, int x, int y)
friend void SpecialKeyUpFunc_(int key, int x, int y)
void StandardKeyUpFunc_(unsigned char key, int x, int y)
std::vector< ContextGLUT * >::iterator registrationIterator_
Definition: ContextGLUT.hh:114
friend void MousePassiveMotionFunc_(int x, int y)
bool RightMouseMoved(int x1, int x2, int y1, int y2)
friend void StandardKeyUpFunc_(unsigned char key, int x, int y)
double GetUserTime() const
return user time (=system usage time) in msec JW For Win32: user-time is the sum over all processes o...
class TimeMeasure contains functions for timing real time and cpu time.
Definition: TimeMeasure.hh:111
void MouseMotionFunc_(int x, int y)
Definition: ContextGLUT.cpp:60
void MousePassiveMotionFunc_(int x, int y)
Base for all classes creating interface between GL and &quot;window manager&quot;.