nuclear@0: #include nuclear@0: #ifdef __APPLE__ nuclear@0: #include nuclear@0: #else nuclear@0: #include nuclear@0: #endif nuclear@0: #include "app.h" nuclear@0: nuclear@0: static void display(); nuclear@0: static void reshape(int x, int y); nuclear@0: static void keydown(unsigned char key, int x, int y); nuclear@0: static void mouse(int bn, int st, int x, int y); nuclear@0: static void motion(int x, int y); nuclear@0: nuclear@0: int main(int argc, char **argv) nuclear@0: { nuclear@1: glutInitWindowSize(1024, 768); nuclear@0: glutInit(&argc, argv); nuclear@0: glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); nuclear@0: glutCreateWindow("cubemapper"); nuclear@0: nuclear@0: glutDisplayFunc(display); nuclear@0: glutReshapeFunc(reshape); nuclear@0: glutKeyboardFunc(keydown); nuclear@0: glutMouseFunc(mouse); nuclear@0: glutMotionFunc(motion); nuclear@0: nuclear@0: if(!app_init(argc, argv)) { nuclear@0: return 1; nuclear@0: } nuclear@0: nuclear@0: glutMainLoop(); nuclear@0: return 0; nuclear@0: } nuclear@0: nuclear@0: void app_quit() nuclear@0: { nuclear@0: app_cleanup(); nuclear@0: exit(0); nuclear@0: } nuclear@0: nuclear@0: void app_redisplay() nuclear@0: { nuclear@0: glutPostRedisplay(); nuclear@0: } nuclear@0: nuclear@0: void app_swap_buffers() nuclear@0: { nuclear@0: glutSwapBuffers(); nuclear@0: } nuclear@0: nuclear@1: void app_resize(int x, int y) nuclear@1: { nuclear@1: glutReshapeWindow(x, y); nuclear@1: } nuclear@1: nuclear@0: static void display() nuclear@0: { nuclear@0: app_draw(); nuclear@0: } nuclear@0: nuclear@0: static void reshape(int x, int y) nuclear@0: { nuclear@0: app_reshape(x, y); nuclear@0: } nuclear@0: nuclear@0: static void keydown(unsigned char key, int x, int y) nuclear@0: { nuclear@0: app_keyboard(key, true); nuclear@0: } nuclear@0: nuclear@0: static void mouse(int bn, int st, int x, int y) nuclear@0: { nuclear@0: app_mouse_button(bn - GLUT_LEFT_BUTTON, st == GLUT_DOWN, x, y); nuclear@0: } nuclear@0: nuclear@0: static void motion(int x, int y) nuclear@0: { nuclear@0: app_mouse_motion(x, y); nuclear@0: }