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