Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4272 in orxonox.OLD for orxonox/trunk/src/subprojects/importer


Ignore:
Timestamp:
May 22, 2005, 8:41:51 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: importer now uses the graphicsEngine to generate a Window → orxonox gets modular

Location:
orxonox/trunk/src/subprojects/importer
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/subprojects/importer/Makefile.am

    r4266 r4272  
    3434
    3535importer_SOURCES= framework.cc \
    36                   windowHandler.cc \
    3736                  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
    3837                  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
  • orxonox/trunk/src/subprojects/importer/Makefile.in

    r4267 r4272  
    5353binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    5454PROGRAMS = $(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)
     55am_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)
    6161importer_OBJECTS = $(am_importer_OBJECTS)
    6262importer_LDADD = $(LDADD)
     
    7474@AMDEP_TRUE@    ./$(DEPDIR)/resource_manager.Po \
    7575@AMDEP_TRUE@    ./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \
    76 @AMDEP_TRUE@    ./$(DEPDIR)/vector.Po ./$(DEPDIR)/windowHandler.Po
     76@AMDEP_TRUE@    ./$(DEPDIR)/vector.Po
    7777CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    7878        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    198198AM_LDFLAGS = $(MWINDOWS)
    199199importer_SOURCES = framework.cc \
    200                   windowHandler.cc \
    201200                  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
    202201                  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
     
    296295@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
    297296@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
    298 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windowHandler.Po@am__quote@
    299297
    300298.cc.o:
  • orxonox/trunk/src/subprojects/importer/framework.cc

    r4263 r4272  
    1919
    2020#include "primitive_model.h"
     21#include "debug.h"
     22#include "graphics_engine.h"
     23
    2124
    2225
     
    6164
    6265  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?
    6467
    6568  // Create a new OpenGL window with the title "Cone3D Basecode" at
    6669  // 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
    7672  if (argc>=3)
    7773    obj = new OBJModel (argv[1], atof(argv[2]));
     
    8177    obj = new PrimitiveModel(CYLINDER);
    8278
    83   M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0);
     79  M = Vector(GraphicsEngine::getInstance()->getResolutionY()/2, GraphicsEngine::getInstance()->getResolutionX()/2, 0);
    8480  rotAxis = Vector (0.0,1.0,0.0);
    8581  rotAngle = 0;
     
    138134            int mX = event.button.x;
    139135            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();
    142138            Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) ));
    143139            //      PRINTF(0)("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z);
     
    182178            int mX = event.button.x;
    183179            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();
    186182            Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) ));
    187183            p1 = tmpV-M;
     
    193189            PRINTF(0)("MouseButton %d pressed at (%d,%d).\n",
    194190                   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;
    196192          }
    197193           
     
    233229      case SDL_QUIT:
    234230        // then we're done and we'll end this program
    235           done=TRUE;
     231          done=true;
    236232          break;
    237233      default:
     
    246242
    247243    // 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;
    249245  }
    250246
     
    252248  if (obj)
    253249    delete obj;
    254   wHandler.KillGLWindow();
     250  delete GraphicsEngine::getInstance();
    255251  // And quit
    256252  return 0;
  • orxonox/trunk/src/subprojects/importer/framework.h

    r4263 r4272  
    22#define _FRAMEWORK_H
    33 
    4 #include "windowHandler.h" // Include the Whandler Basecode
    54#include "objModel.h"
    65#include "vector.h"
    7 
    8 class Vector;
    96
    107float rotatorP;
     
    3431bool mouse1Down;
    3532
    36 WindowHandler wHandler;  // Create an instance of the whandler basecode class
    3733Model* obj;
    3834
Note: See TracChangeset for help on using the changeset viewer.