|
|
|
|||||||||||
|
|
|
![]() |
|
|
|
|||||||
|
|
|
|
|
|
||||||||
|
|
|
|||||||||||
|
|
|
|
|
|||||||||
How to use keyboard interactions with GLUTThis opengl tutorial will teach you how to add keyboard interaction to your opengl application through the use of glut and glut's keyboard calls. Now glut has many different keyboard calls, but in this opengl tutorial I will only be teaching you the very basics so that when you press the ESC key, glut will end your opengl application. You will have to look into my camera tutorials for more information on how to use the keyboard. Using the keyboard is extrememly simple, you need a function for the keyboard also keep in mind that because we are using GLUT we can easily gather input #include <GL/gl.h> void display (void) { void keyboard (unsigned char key, int x, int y) { int main (int argc, char **argv) { |
|
|||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright 2008, Donald Urquhart |
||||||||||||