From b4387926feba2901f2301073c7b9abde3f64ad36 Mon Sep 17 00:00:00 2001 From: spixx Date: Sat, 4 Nov 2006 19:26:49 +0000 Subject: [PATCH] not needed (no glut...) --- src/callbacks.cpp | 180 ---------------------------------------------- src/callbacks.h | 81 --------------------- 2 files changed, 261 deletions(-) delete mode 100644 src/callbacks.cpp delete mode 100644 src/callbacks.h diff --git a/src/callbacks.cpp b/src/callbacks.cpp deleted file mode 100644 index b4437b2..0000000 --- a/src/callbacks.cpp +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (C) 2006 Erik Dahlberg -// -// This file is part of LSystem3d. -// -// LSystem3D is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// LSystem3D is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with LSystem3D; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - - - -#include - -#include - -#include "callbacks.h" -#include "openglwindow.h" - -extern OpenGLWindow *openglWindow; - - - -// GLUT callback functions -// ----------------------- - -/** - * Key press - * @param key the key - * @param x mouse x-coordinate - * @param y mouse y-coordinate - */ -void glutKeyboardCB(unsigned char key, int x, int y) -{ - switch (key) - { - // quit - case 27: // escape key - glutLeaveMainLoop(); - break; - - // zoom in - case '+': - openglWindow->zoomIn(); - break; - - // zoom out - case '-': - openglWindow->zoomOut(); - break; - - // rotate around the y-axis - case 'y': - case 'Y': - openglWindow->rotateY(); - - default: - break; - } -} - - - -/** - * Special key press - * @param key the key - * @param x mouse x-coordinate - * @param y mouse y-coordinate - */ -void glutSpecialCB(int key, int x, int y) -{ - switch (key) - { - // move camera left - case GLUT_KEY_LEFT: - openglWindow->left(); - break; - - // move camera right - case GLUT_KEY_RIGHT: - openglWindow->right(); - break; - - // move camera up - case GLUT_KEY_UP: - openglWindow->up(); - break; - - // move camera down - case GLUT_KEY_DOWN: - openglWindow->down(); - break; - - // move camera forth - case GLUT_KEY_PAGE_UP: - openglWindow->forth(); - break; - - // move camera back - case GLUT_KEY_PAGE_DOWN: - openglWindow->back(); - break; - - default: - break; - } -} - - - -/** - * Redraw of screen - */ -void glutDisplayCB() -{ - openglWindow->draw(); -} - - - -/** - * Idling - */ -void glutIdleCB() -{ - // spare some cpu cycles - usleep(1); -} - - - -// GLUI callback functions -// ----------------------- - -/** - * Angle changes - * @param id not used - */ -void gluiSpinnerAngleCB(int id) -{ - // regenerate and draw l-system only if "live mode" is enabled - - if (openglWindow->liveActivated()) - { - openglWindow->generate(); - glutPostRedisplay(); - } -} - - - -/** - * Reset button pressed - * @param id not used - */ -void gluiButtonResetCB(int id) -{ - // place camera at initial position - openglWindow->defaultView(); -} - - - -/** - * Generate button pressed - * @param id not used - */ -void gluiButtonGenerateCB(int id) -{ - openglWindow->generate(); -} diff --git a/src/callbacks.h b/src/callbacks.h deleted file mode 100644 index f827f4d..0000000 --- a/src/callbacks.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) 2006 Erik Dahlberg -// -// This file is part of LSystem3d. -// -// LSystem3D is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// LSystem3D is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with LSystem3D; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - - - -#ifndef CALLBACKS_H -#define CALLBACKS_H - - - -// GLUT callback functions -// ----------------------- - -/** - * Key press - * @param key the key - * @param x mouse x-coordinate - * @param y mouse y-coordinate - */ -void glutKeyboardCB(unsigned char key, int x, int y); - -/** - * Special key press - * @param key the key - * @param x mouse x-coordinate - * @param y mouse y-coordinate - */ -void glutSpecialCB(int key, int x, int y); - -/** - * Redraw of screen - */ -void glutDisplayCB(); - -/** - * Idling - */ -void glutIdleCB(); - - - -// GLUI callback functions -// ----------------------- - -/** - * Angle changes - * @param id not used - */ -void gluiSpinnerAngleCB(int id); - -/** - * Reset button pressed - * @param id not used - */ -void gluiButtonResetCB(int id); - -/** - * Generate button pressed - * @param id not used - */ -void gluiButtonGenerateCB(int id); - - - -#endif -- 2.34.1