Changeset 4272 in orxonox.OLD for orxonox/trunk/src/subprojects/importer/framework.cc
- Timestamp:
- May 22, 2005, 8:41:51 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/subprojects/importer/framework.cc
r4263 r4272 19 19 20 20 #include "primitive_model.h" 21 #include "debug.h" 22 #include "graphics_engine.h" 23 21 24 22 25 … … 61 64 62 65 Uint8* keys; // This variable will be used in the keyboard routine 63 int done =FALSE; // We aren't done yet, are we?66 int done = false; // We aren't done yet, are we? 64 67 65 68 // Create a new OpenGL window with the title "Cone3D Basecode" at 66 69 // 640x480x32, fullscreen and check for errors along the way 67 if(wHandler.CreateGLWindow("Whandler Basecode", 800, 600, 32, FALSE) == FALSE) 68 { 69 // If an error is found, display a message, kill the GL and SDL screens (if they were created) and exit 70 PRINTF(1)("Could not initalize OpenGL :(\n\n"); 71 wHandler.KillGLWindow(); 72 return 0; 73 } 74 75 PRINTF(2)("screensize: %i, %i\n", wHandler.screen->w, wHandler.screen->h); 70 GraphicsEngine::getInstance(); 71 76 72 if (argc>=3) 77 73 obj = new OBJModel (argv[1], atof(argv[2])); … … 81 77 obj = new PrimitiveModel(CYLINDER); 82 78 83 M = Vector( wHandler.screen->w/2, wHandler.screen->h/2, 0);79 M = Vector(GraphicsEngine::getInstance()->getResolutionY()/2, GraphicsEngine::getInstance()->getResolutionX()/2, 0); 84 80 rotAxis = Vector (0.0,1.0,0.0); 85 81 rotAngle = 0; … … 138 134 int mX = event.button.x; 139 135 int mY = event.button.y; 140 int wH = wHandler.screen->h;141 int wW = wHandler.screen->w;136 int wH = GraphicsEngine::getInstance()->getResolutionY(); 137 int wW = GraphicsEngine::getInstance()->getResolutionX(); 142 138 Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) )); 143 139 // PRINTF(0)("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z); … … 182 178 int mX = event.button.x; 183 179 int mY = event.button.y; 184 int wH = wHandler.screen->h;185 int wW = wHandler.screen->w;180 int wH = GraphicsEngine::getInstance()->getResolutionY(); 181 int wW = GraphicsEngine::getInstance()->getResolutionX(); 186 182 Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) )); 187 183 p1 = tmpV-M; … … 193 189 PRINTF(0)("MouseButton %d pressed at (%d,%d).\n", 194 190 event.button.button, event.button.x, event.button.y); 195 rotatorV = ( (float) wHandler.screen->w/2 -event.button.x) / (float)wHandler.screen->w/ 100.0;191 rotatorV = ( (float)GraphicsEngine::getInstance()->getResolutionY()/2 -event.button.x) / (float)GraphicsEngine::getInstance()->getResolutionY() / 100.0; 196 192 } 197 193 … … 233 229 case SDL_QUIT: 234 230 // then we're done and we'll end this program 235 done= TRUE;231 done=true; 236 232 break; 237 233 default: … … 246 242 247 243 // and check if ESCAPE has been pressed. If so then quit 248 if(keys[SDLK_ESCAPE]) done= TRUE;244 if(keys[SDLK_ESCAPE]) done=true; 249 245 } 250 246 … … 252 248 if (obj) 253 249 delete obj; 254 wHandler.KillGLWindow();250 delete GraphicsEngine::getInstance(); 255 251 // And quit 256 252 return 0;
Note: See TracChangeset
for help on using the changeset viewer.