Beruflich Dokumente
Kultur Dokumente
GLUT _RGB GLUT _RGBA GLUT _INDEX GLUT _DOUBLE GLUT _SINGLE
GLUT_ DEPTH
Rendering Callback
It is invoked when the system senses that the contents of the window need to be redisplayed, either because:
graphics window has completed its initial creation the program explicitly requests redrawing, by calling glutPostRedisplay()
void my_display (void ) { glClear( GL_COLOR_BUFFER_BIT ); glBegin( GL_TRIANGLE ); glEnd(); }
Idle Callback
This callback is called when an idle event is generated An idle event is generated every time the system has nothing better to do. Use for animation and continuous update void idle( void ) { .. glutPostRedisplay(); }
Keyboard Callbacs
Called if a keyboard key is pressed void my_key_events (char key, int x, int y ) { switch ( key ) { case q : case Q : .. break; case r : case R : . break; } }
Mouse Callback
Called when mouse is clicked/pressed
void myMouse(int button, int state, int x, int y) { if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) { } }
GLUT_KEY_F11 GLUT_KEY_F12 GLUT_KEY_LEFT GLUT_KEY_UP GLUT_KEY_RIGHT GLUT_KEY_DOWN GLUT_KEY_PAGE GLUT_KEY_PAGE GLUT_KEY_HOME GLUT_KEY_END GLUT_KEY_INSERT