root/juggler/branches/2.2/modules/vrjuggler/tools/trackerConfig.cpp
| Revision 19729, 3.0 kB (checked in by patrick, 2 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | /*************** <auto-copyright.pl BEGIN do not edit this line> ************** |
| 2 | * |
| 3 | * VR Juggler is (C) Copyright 1998-2007 by Iowa State University |
| 4 | * |
| 5 | * Original Authors: |
| 6 | * Allen Bierbaum, Christopher Just, |
| 7 | * Patrick Hartling, Kevin Meinert, |
| 8 | * Carolina Cruz-Neira, Albert Baker |
| 9 | * |
| 10 | * This library is free software; you can redistribute it and/or |
| 11 | * modify it under the terms of the GNU Library General Public |
| 12 | * License as published by the Free Software Foundation; either |
| 13 | * version 2 of the License, or (at your option) any later version. |
| 14 | * |
| 15 | * This library is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 18 | * Library General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU Library General Public |
| 21 | * License along with this library; if not, write to the |
| 22 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 23 | * Boston, MA 02111-1307, USA. |
| 24 | * |
| 25 | *************** <auto-copyright.pl END do not edit this line> ***************/ |
| 26 | |
| 27 | #include <GL/glut.h> |
| 28 | #include <stdio.h> |
| 29 | |
| 30 | #include "trackerConfigApp.h" |
| 31 | #include "trackerConfigMenu.h" |
| 32 | |
| 33 | ///////////////////////////////////////////////////////////////// |
| 34 | // The GLUT Application // |
| 35 | ///////////////////////////////////////////////////////////////// |
| 36 | trackerConfigApp* theApp; // This must be set to the application |
| 37 | |
| 38 | void setApplication() |
| 39 | { |
| 40 | theApp = trackerConfigApp::getInstance(); |
| 41 | } |
| 42 | |
| 43 | void initAppWindows() |
| 44 | { |
| 45 | theApp->initWindows(); |
| 46 | } |
| 47 | |
| 48 | void reshape(int w, int h) |
| 49 | { |
| 50 | /* Because Gil specified "screen coordinates" (presumably with an |
| 51 | upper-left origin), this short bit of code sets up the coordinate |
| 52 | system to correspond to actual window coodrinates. This code |
| 53 | wouldn't be required if you chose a (more typical in 3D) abstract |
| 54 | coordinate system. */ |
| 55 | |
| 56 | glViewport(0, 0, w, h); /* Establish viewing area to cover entire window. */ |
| 57 | glMatrixMode(GL_PROJECTION); /* Start modifying the projection matrix. */ |
| 58 | glLoadIdentity(); /* Reset project matrix. */ |
| 59 | glOrtho(0, w, 0, h, -1, 1); /* Map abstract coords directly to window coords. */ |
| 60 | glScalef(1, -1, 1); /* Invert Y axis so increasing Y goes down. */ |
| 61 | glTranslatef(0, -h, 0); /* Shift origin up to upper-left corner. */ |
| 62 | } |
| 63 | |
| 64 | |
| 65 | int main(int argc, char **argv) |
| 66 | { |
| 67 | setApplication(); |
| 68 | |
| 69 | //glutInitWindowSize(400,400); // Set window size |
| 70 | //glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); // Setup framebuffer |
| 71 | glutInit(&argc, argv); |
| 72 | |
| 73 | // ---- Create windows ---- // |
| 74 | initAppWindows(); |
| 75 | |
| 76 | // For standalone application |
| 77 | glutIdleFunc(sgGlutApp::cbIdle); |
| 78 | |
| 79 | // If have windows |
| 80 | trackerConfigMenu::getInstance()->registerGlutIdle(sgGlutApp::cbIdle); |
| 81 | trackerConfigMenu::getInstance()->setApp(theApp); |
| 82 | |
| 83 | //glutReshapeFunc(reshape); |
| 84 | |
| 85 | glutMainLoop(); // Will NEVER return. just LOOPS |
| 86 | return 0; // ANSI C requires main to return int |
| 87 | } |
| 88 |
Note: See TracBrowser for help on using the browser.
