Changeset 1850 in orxonox.OLD for orxonox/trunk/core/orxonox.cc
- Timestamp:
- Apr 21, 2004, 1:11:19 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/core/orxonox.cc
r1849 r1850 1 /* 2 orxonox - the future of 3D-vertical-scrollers 3 4 Copyright (C) 2004 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software Foundation, 18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 20 */ 21 22 23 24 25 26 1 27 /* class definition header */ 2 28 #include "orxonox.h" … … 13 39 14 40 15 Orxonox::Orxonox() {} 16 Orxonox::~Orxonox() {} 41 Orxonox::Orxonox () {} 17 42 18 43 19 int Orxonox::globalInit(int argc, char** argv) 44 45 Orxonox::~Orxonox () {} 46 47 48 /* this is a singleton class to prevent dublicates */ 49 Orxonox* Orxonox::singleton_ref = 0; 50 Orxonox* Orxonox::getInstance (void) 51 { 52 if (singleton_ref == NULL) 53 singleton_ref = new Orxonox(); 54 return singleton_ref; 55 } 56 57 58 59 int Orxonox::globalInit (int argc, char** argv) 20 60 { 21 61 glutInit(&argc, argv); … … 25 65 glutCreateWindow("orxOnox"); 26 66 /* window event dispatchers */ 27 /* 28 glutDisplayFunc(display); 29 glutReshapeFunc(resphape); 30 glutMainLoop(); 31 */ 67 glutDisplayFunc(display); 68 glutReshapeFunc(reshape); 32 69 } 33 70 34 71 35 int Orxonox::menuInit() 72 73 int Orxonox::menuInit (void) 36 74 { 37 75 glClearColor(0.0, 0.0, 0.0, 0.0); 76 } 77 78 79 80 int Orxonox::gameInit (void) 81 { 38 82 39 83 } … … 41 85 42 86 43 int Orxonox::gameInit()87 void Orxonox::display (void) 44 88 { 89 glClear(GL_COLOR_BUFFER_BIT); 90 glutSwapBuffers(); 91 } 45 92 93 94 95 void Orxonox::reshape (int w, int h) 96 { 97 glViewport(0, 0, (GLsizei) w, (GLsizei) h); 98 glMatrixMode(GL_PROJECTION); 99 glLoadIdentity(); 100 glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0); 101 glMatrixMode(GL_MODELVIEW); 102 glLoadIdentity(); //pb why a second time? 46 103 } 47 104 48 105 49 int main( int argc, char** argv ) 106 107 int main (int argc, char** argv) 50 108 { 51 Orxonox orx;52 orx.globalInit(argc, argv);53 orx.menuInit();54 109 Orxonox *orx = Orxonox::getInstance(); 110 (*orx).globalInit(argc, argv); 111 (*orx).menuInit(); 112 glutMainLoop(); 55 113 return 0; 56 114 }
Note: See TracChangeset
for help on using the changeset viewer.