home *** CD-ROM | disk | FTP | other *** search
/ Game Programming in C++ - Start to Finish / GameProgrammingS.iso / developer_install / CEGUISDK-0.4.1-VC6-STLport.exe / {app} / Samples / common / include / CEGuiOpenGLBaseApplication.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-09-01  |  2.9 KB  |  84 lines

  1. /************************************************************************
  2.     filename:   CEGuiOpenGLBaseApplication.h
  3.     created:    24/9/2004
  4.     author:     Paul D Turner
  5. *************************************************************************/
  6. /*************************************************************************
  7.     Crazy Eddie's GUI System (http://www.cegui.org.uk)
  8.     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
  9.  
  10.     This library is free software; you can redistribute it and/or
  11.     modify it under the terms of the GNU Lesser General Public
  12.     License as published by the Free Software Foundation; either
  13.     version 2.1 of the License, or (at your option) any later version.
  14.  
  15.     This library is distributed in the hope that it will be useful,
  16.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18.     Lesser General Public License for more details.
  19.  
  20.     You should have received a copy of the GNU Lesser General Public
  21.     License along with this library; if not, write to the Free Software
  22.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23. *************************************************************************/
  24. #ifndef _CEGuiOpenGLBaseApplication_h_
  25. #define _CEGuiOpenGLBaseApplication_h_
  26.  
  27. #include "CEGuiBaseApplication.h"
  28. // remove Microsoft idiocy
  29. #undef max
  30. #undef min
  31.  
  32.  
  33. #include "CEGUI.h"
  34.  
  35.  
  36. class CEGuiOpenGLBaseApplication : public CEGuiBaseApplication
  37. {
  38. public:
  39.     /*!
  40.     \brief
  41.         Constructor.
  42.     */
  43.     CEGuiOpenGLBaseApplication();
  44.  
  45.  
  46.     /*!
  47.     \brief
  48.         Destructor.
  49.     */
  50.     virtual ~CEGuiOpenGLBaseApplication();
  51.  
  52.  
  53.     // implementation of base class abstract methods.
  54.     bool execute(CEGuiSample* sampleApp);
  55.     void cleanup();
  56.  
  57.     // overrides of other base class methods.
  58.     // These are required to make the 'quit' flag field static to enable us
  59.     // to access it via the static methods employed by glut.
  60.     void setQuitting(bool quit = true);
  61.     bool isQuitting() const;
  62.  
  63. protected:
  64.     /*************************************************************************
  65.         Implementation Methods
  66.     *************************************************************************/
  67.     static void drawFrame(void);
  68.     static void reshape(int w, int h);
  69.     static void mouseMotion(int x, int y);
  70.     static void mouseButton(int button, int state, int x, int y);
  71.     static void keyChar(unsigned char key, int x, int y);
  72.     static void keySpecial(int key, int x, int y);
  73.  
  74.     /*************************************************************************
  75.         Data fields
  76.     *************************************************************************/
  77.     CEGUI::Renderer* d_renderer;
  78.     static bool d_quitFlag;
  79.     static int  d_lastFrameTime;
  80. };
  81.  
  82.  
  83. #endif  // end of guard _CEGuiOpenGLBaseApplication_h_
  84.