Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

orxonox/trunk: windowName defineable by the GraphicsEngine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.