Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4619 in orxonox.OLD


Ignore:
Timestamp:
Jun 13, 2005, 10:30:08 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: windowName defineable by the GraphicsEngine

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4597 r4619  
    9595  this->setResolution(800, 600, 16);
    9696
    97   // Set window labeling
    98   SDL_WM_SetCaption ("Orxonox " PACKAGE_VERSION, "Orxonox " PACKAGE_VERSION);
    9997
    10098  // TO DO: Create a cool icon and use it here
     
    106104  glEnable(GL_DEPTH_TEST);
    107105}
     106
     107
     108/**
     109 * sets the Window Captions and the Name of the icon.
     110 * @param windowName The name of the Window
     111 * @param icon The name of the Icon on the Disc
     112 */
     113void GraphicsEngine::setWindowName(const char* windowName, const char* icon)
     114{
     115  // Set window labeling
     116  SDL_WM_SetCaption (windowName, icon);
     117}
     118
    108119
    109120/**
  • orxonox/trunk/src/lib/graphics/graphics_engine.h

    r4536 r4619  
    1 /*! 
     1/*!
    22    \file graphics_engine.h
    3    
     3
    44    \brief defines a Interface between orxonox and graphical input
    55
     
    2121/**
    2222   handles graphical SDL-initialisation, textures, resolutions, and so on
    23 */   
    24 class GraphicsEngine : public BaseObject 
     23 */
     24class GraphicsEngine : public BaseObject
    2525{
    26  public:
    27   virtual ~GraphicsEngine();
    28   /** \returns a Pointer to the only object of this Class */
    29   inline static GraphicsEngine* getInstance(void) { if (!singletonRef) singletonRef = new GraphicsEngine();  return singletonRef; };
     26  public:
     27    virtual ~GraphicsEngine();
     28    /** \returns a Pointer to the only object of this Class */
     29    inline static GraphicsEngine* getInstance(void) { if (!singletonRef) singletonRef = new GraphicsEngine();  return singletonRef; };
    3030
    31   int initVideo();
    32   int setGLattribs(void);
    33   int setResolution(int width, int height, int bpp);
    34   void setFullscreen(bool fullscreen = false);
    35   static void setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha = 1.0);
     31    int initVideo();
    3632
    37   /** \returns the x resolution */
    38   inline int getResolutionX(void) const {return this->resolutionX;}
    39   /** \returns the y resolution */
    40   inline int getResolutionY(void) const {return this->resolutionY;}
    41   /** \returns the Bits Per Pixel */
    42   inline int getbbp(void) const {return this->bitsPerPixel;}
    43   int resolutionChanged(SDL_ResizeEvent* resizeInfo);
    44   void listModes(void);
     33    void setWindowName(const char* windowName, const char* icon);
     34    int setGLattribs(void);
     35    int setResolution(int width, int height, int bpp);
     36    void setFullscreen(bool fullscreen = false);
     37    static void setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha = 1.0);
    4538
    46   static bool texturesEnabled;
     39    /** \returns the x resolution */
     40    inline int getResolutionX(void) const { return this->resolutionX; };
     41    /** \returns the y resolution */
     42    inline int getResolutionY(void) const { return this->resolutionY; };
     43    /** \returns the Bits Per Pixel */
     44    inline int getbbp(void) const { return this->bitsPerPixel; };
    4745
    48   static void enter2DMode(void);
    49   static void leave2DMode(void);
     46    int resolutionChanged(SDL_ResizeEvent* resizeInfo);
    5047
    51   static void storeMatrices(void);
    52   static GLdouble modMat[16];
    53   static GLdouble projMat[16];
    54   static GLint viewPort[4];
    55  
    56   void tick(float dt);
    57   void displayFPS(bool display);
     48    static void enter2DMode(void);
     49    static void leave2DMode(void);
    5850
     51    static void storeMatrices(void);
     52    static GLdouble modMat[16];
     53    static GLdouble projMat[16];
     54    static GLint viewPort[4];
    5955
    60  private:
    61   GraphicsEngine();
    62   static GraphicsEngine* singletonRef;
     56    void tick(float dt);
     57    void displayFPS(bool display);
    6358
    64  private:
    65   SDL_Surface*   screen;          //!< the screen we draw to
    66   int            resolutionX;     //!< the X-resoultion of the screen
    67   int            resolutionY;     //!< the Y-resolution of the screen
    68   int            bitsPerPixel;    //!< the bits per pixels of the screen
    69   bool           fullscreen;      //!< if we are in fullscreen mode
    70   Uint32         videoFlags;      //!< flags for video
    71   SDL_Rect**     videoModes;      //!< list of resolutions
    72  
    73   bool           bDisplayFPS;     //!< is true if the fps should be displayed
    74   float          currentFPS;      //!< the current frame rate: frames per seconds
    75   float          maxFPS;          //!< maximal frame rate we ever got since start of the game
    76   float          minFPS;          //!< minimal frame rate we ever got since start
     59    void listModes(void);
     60
     61  public:
     62    static bool texturesEnabled;
     63
     64  private:
     65    GraphicsEngine();
     66
     67  private:
     68    static GraphicsEngine* singletonRef;
     69
     70    SDL_Surface*   screen;          //!< the screen we draw to
     71    int            resolutionX;     //!< the X-resoultion of the screen
     72    int            resolutionY;     //!< the Y-resolution of the screen
     73    int            bitsPerPixel;    //!< the bits per pixels of the screen
     74    bool           fullscreen;      //!< if we are in fullscreen mode
     75    Uint32         videoFlags;      //!< flags for video
     76    SDL_Rect**     videoModes;      //!< list of resolutions
     77
     78    bool           bDisplayFPS;     //!< is true if the fps should be displayed
     79    float          currentFPS;      //!< the current frame rate: frames per seconds
     80    float          maxFPS;          //!< maximal frame rate we ever got since start of the game
     81    float          minFPS;          //!< minimal frame rate we ever got since start
     82
    7783
    7884#ifndef NO_TEXT
  • orxonox/trunk/src/orxonox.cc

    r4616 r4619  
    144144
    145145  GraphicsEngine::getInstance();
     146  GraphicsEngine::getInstance()->setWindowName("orxonox " PACKAGE_VERSION, "orxonox " PACKAGE_VERSION);
    146147
    147148  return 0;
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r4618 r4619  
    3131{
    3232  CDEngine::getInstance();
    33   CDEngine::getInstance()->debug();
     33  //CDEngine::getInstance()->debug();
    3434
    35   //model = new MD2Model("models/tris.md2", "models/tris.pcx");
    36   //model->tick(0.1f);
    37   //CDEngine::getInstance()->debugSpawnTree(2, model->data->pVertices, model->data->numVertices);
     35  model = new MD2Model("models/tris.md2", "models/tris.pcx");
     36  model->tick(0.1f);
     37  CDEngine::getInstance()->debugSpawnTree(1, model->data->pVertices, model->data->numVertices);
    3838
    3939  LightManager* lightMan = LightManager::getInstance();
     
    7070  LightManager::getInstance()->draw();
    7171
    72   //model->draw();
     72  model->draw();
    7373}
    7474
Note: See TracChangeset for help on using the changeset viewer.