Changeset 1879 in orxonox.OLD for orxonox/trunk/core/orxonox.cc
- Timestamp:
- May 8, 2004, 1:12:33 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/core/orxonox.cc
r1875 r1879 54 54 bool Orxonox::rightWeGo = false; 55 55 bool Orxonox::leftWeGo = false; 56 int Orxonox::alpha = 0; 57 int Orxonox::beta = 0; 58 //int Orxonox::offsetX = 0; 59 //int Orxonox::offsetY = 0; 56 60 57 61 Orxonox* Orxonox::getInstance (void) … … 68 72 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); 69 73 glutInitWindowSize(500, 500); 74 //glutFullScreen(); 70 75 glutInitWindowPosition(100, 100); 71 76 glutCreateWindow("orxOnox"); … … 93 98 // (*localPlayer).addIO(io); 94 99 95 glutIgnoreKeyRepeat(1); /* for win32 */96 glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF); /* for linux X11 */100 //glutIgnoreKeyRepeat(1); /* for win32 */ 101 //glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF); /* for linux X11 */ 97 102 glutSpecialFunc(specFunc); 98 103 glutSpecialUpFunc(releaseKey); … … 107 112 { 108 113 switch(key) { 114 115 /* perspectiv control */ 116 case 'w': 117 beta -= 1; 118 break; 119 case 's': 120 beta += 1; 121 break; 122 case 'a': 123 alpha -= 1; 124 break; 125 case 'd': 126 alpha += 1; 127 break; 128 129 /* game controls */ 109 130 110 131 case 'p': … … 131 152 void Orxonox::quitGame() 132 153 { 133 glutSetKeyRepeat(GLUT_KEY_REPEAT_DEFAULT); /*do not remove or you will have 134 no repeating keys anymore...*/ 154 //glutIgnoreKeyRepeat(0); /* for win32 */ 155 //glutSetKeyRepeat(GLUT_KEY_REPEAT_DEFAULT); /*do not remove or you will have 156 // no repeating keys anymore...*/ 135 157 cout << "finished garbage colletion, quitting..." << endl; 136 158 exit(0); … … 165 187 { 166 188 switch(key) { 189 190 /* spacecraft controls */ 191 167 192 case GLUT_KEY_UP: 168 193 upWeGo = true; … … 184 209 { 185 210 glClear(GL_COLOR_BUFFER_BIT); 211 212 glColor3f(0.0, 0.5, 0.6); 213 glLoadIdentity(); 214 gluLookAt(0.0, -14.0, 15.0, 0.0 + alpha, 0.0 + beta, 0.0, 0.0, 1.0, 0.0); 186 215 (*world).drawWorld(); 216 187 217 glutSwapBuffers(); 188 218 } … … 203 233 } 204 234 /* request repaint */ 235 236 //cout << "contiousRedraw" << endl; 205 237 glutPostRedisplay(); 206 238 } … … 212 244 glMatrixMode(GL_PROJECTION); 213 245 glLoadIdentity(); 214 glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0); 246 //glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0); pb: //simple and working 247 glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 200.0); 248 //glFrustum(-10.0, 10.0, -5.0, 10.0, 0.0, 100.0); 215 249 glMatrixMode(GL_MODELVIEW); 216 250 glLoadIdentity(); //pb why a second time? … … 220 254 void Orxonox::testTheShit() 221 255 { 222 Player* pl = new Player;223 (*pl).setPosition(1, 1, 1);224 (*world).addPlayer(pl);256 //Player* pl = new Player; 257 //(*pl).setPosition(1, 1, 1); 258 //(*world).addPlayer(pl); 225 259 226 260 //NPC* nl = new NPC;
Note: See TracChangeset
for help on using the changeset viewer.