GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Tuesday, March 1, 2011

OpenGL - Keyboard Function

/**
 * Call this function in the main entry point with
 * glutKeyboardFunc(keyboard);
 */

/**
 * x - mouse pointer position - zero to corner of window
 * y - mouse pointer position - zero to corner of window
 */
void keyboard(unsigned char key, int x, int y){
    switch(key){
        case 'a':
            cout << "You type a" << endl;
            break;
        case 'b':
            cout << "You type b" << endl;
            break;
    }
}

Share/Bookmark

No comments:

Post a Comment