int main(int argc, const char *argv[]){ screen_width = (unsigned int)CGDisplayPixelsWide(kCGDirectMainDisplay); screen_height = (unsigned int)CGDisplayPixelsHigh(kCGDirectMainDisplay); CGPoint current_point = CGEventGetLocation(CGEventCreate(nil)); screen = controller.calibratedScreens()[0]; if(!screen.isValid()){ cout << "This screen has not been calibrated." << endl; return 0; } // Create a sample listener and controller SampleListener listener; // Have the sample listener receive events from the controller controller.addListener(listener); // Keep this process running until Enter is pressed std::cout << "Press Enter to quit..." << std::endl; std::cin.get(); // Remove the sample listener when done controller.removeListener(listener); return 0; }
int main(int argc , char ** argv) { screen = controller.calibratedScreens()[0]; if(!screen.isValid()){ cout << "This screen has not been calibrated." << endl; return 0; } srand((unsigned int)time(NULL)); // Have the sample listener receive events from the controller controller.addListener(listener); glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA); glutInitWindowSize(screen_width, screen_height); glutInitWindowPosition(0, 0); window = glutCreateWindow("LEAP intersection Test"); glutDisplayFunc(&DrawGLScene); glutIdleFunc(&Idle); glutReshapeFunc(&ReSizeGLScene); glutKeyboardFunc(&NormalKeyPressed); glutSpecialFunc(&SpecialKeyPressed); glDisable(GL_DEPTH_TEST); // Disables Depth Testing glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading glutMainLoop(); return 0; }