Changeset 4272 in orxonox.OLD for orxonox/trunk
- Timestamp:
- May 22, 2005, 8:41:51 PM (20 years ago)
- Location:
- orxonox/trunk/src/subprojects/importer
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/subprojects/importer/Makefile.am
r4266 r4272 34 34 35 35 importer_SOURCES= framework.cc \ 36 windowHandler.cc \37 36 $(MAINSRCDIR)/lib/graphics/importer/model.cc \ 38 37 $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \ -
orxonox/trunk/src/subprojects/importer/Makefile.in
r4267 r4272 53 53 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) 54 54 PROGRAMS = $(bin_PROGRAMS) 55 am_importer_OBJECTS = framework.$(OBJEXT) windowHandler.$(OBJEXT) \56 model.$(OBJEXT) objModel.$(OBJEXT) primitive_model.$(OBJEXT) \57 array.$(OBJEXT) material.$(OBJEXT) texture.$(OBJEXT) \58 graphics_engine.$(OBJEXT) base_object.$(OBJEXT) \59 vector.$(OBJEXT) resource_manager.$(OBJEXT) \60 text_engine.$(OBJEXT)p_node.$(OBJEXT) null_parent.$(OBJEXT)55 am_importer_OBJECTS = framework.$(OBJEXT) model.$(OBJEXT) \ 56 objModel.$(OBJEXT) primitive_model.$(OBJEXT) array.$(OBJEXT) \ 57 material.$(OBJEXT) texture.$(OBJEXT) graphics_engine.$(OBJEXT) \ 58 base_object.$(OBJEXT) vector.$(OBJEXT) \ 59 resource_manager.$(OBJEXT) text_engine.$(OBJEXT) \ 60 p_node.$(OBJEXT) null_parent.$(OBJEXT) 61 61 importer_OBJECTS = $(am_importer_OBJECTS) 62 62 importer_LDADD = $(LDADD) … … 74 74 @AMDEP_TRUE@ ./$(DEPDIR)/resource_manager.Po \ 75 75 @AMDEP_TRUE@ ./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \ 76 @AMDEP_TRUE@ ./$(DEPDIR)/vector.Po ./$(DEPDIR)/windowHandler.Po76 @AMDEP_TRUE@ ./$(DEPDIR)/vector.Po 77 77 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 78 78 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 198 198 AM_LDFLAGS = $(MWINDOWS) 199 199 importer_SOURCES = framework.cc \ 200 windowHandler.cc \201 200 $(MAINSRCDIR)/lib/graphics/importer/model.cc \ 202 201 $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \ … … 296 295 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@ 297 296 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ 298 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windowHandler.Po@am__quote@299 297 300 298 .cc.o: -
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; -
orxonox/trunk/src/subprojects/importer/framework.h
r4263 r4272 2 2 #define _FRAMEWORK_H 3 3 4 #include "windowHandler.h" // Include the Whandler Basecode5 4 #include "objModel.h" 6 5 #include "vector.h" 7 8 class Vector;9 6 10 7 float rotatorP; … … 34 31 bool mouse1Down; 35 32 36 WindowHandler wHandler; // Create an instance of the whandler basecode class37 33 Model* obj; 38 34
Note: See TracChangeset
for help on using the changeset viewer.