Crazy Eddie's GUI System  ${CEGUI_VERSION}
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGuiIrrlichtBaseApplication.h
1 /***********************************************************************
2  created: 24/9/2004
3  author: Paul D Turner
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGuiIrrlichtBaseApplication_h_
28 #define _CEGuiIrrlichtBaseApplication_h_
29 
30 #if defined(_WIN32)
31 # pragma comment(lib, "irrlicht.lib")
32 #if !defined(CEGUI_STATIC)
33 # if defined(_DEBUG)
34 # pragma comment(lib, "CEGUIIrrlichtRenderer_d.lib")
35 # else
36 # pragma comment(lib, "CEGUIIrrlichtRenderer.lib")
37 # endif
38 #else
39 # define _IRR_STATIC_LIB_ //Define this regardless if we are using a dll or not
40 # if defined(_DEBUG)
41 # pragma comment(lib, "CEGUIIrrlichtRenderer_Static_d.lib")
42 # else
43 # pragma comment(lib, "CEGUIIrrlichtRenderer_Static.lib")
44 # endif
45 #endif
46 #endif
47 
48 #include "CEGuiBaseApplication.h"
49 #include "CEGUI/Size.h"
50 
51 #include <irrlicht.h>
52 
53 namespace CEGUI
54 {
55  class IrrlichtEventPusher;
56 }
57 
59  public irr::IEventReceiver
60 {
61 public:
64  void destroyRenderer();
65 
66  // irrlicht event listener
67 #if CEGUI_IRR_SDK_VERSION >= 14
68  bool OnEvent(const irr::SEvent& event);
69 #else
70  bool OnEvent(irr::SEvent event);
71 #endif
72 
73 protected:
75  void checkWindowResize();
76 
77  // implementation of base class abstract methods.
78  void run();
79  void destroyWindow();
80  void beginRendering(const float elapsed);
81  void endRendering();
82 
83  bool processEvent(const irr::SEvent& event);
84 
85  bool OnKeyDown(irr::EKEY_CODE key, wchar_t wch, bool /*ctrl*/, bool /*shift*/);
86  bool OnKeyUp(irr::EKEY_CODE key, wchar_t /*wch*/, bool /*ctrl*/, bool /*shift*/);
87  bool OnMouse(irr::s32 x, irr::s32 y, irr::f32 w, irr::EMOUSE_INPUT_EVENT e);
88 
89  irr::IrrlichtDevice* d_device;
90  irr::video::IVideoDriver* d_driver;
91  irr::scene::ISceneManager* d_smgr;
92  irr::u32 d_lastTime;
93 
94  const CEGUI::IrrlichtEventPusher* d_eventPusher;
95 
98 };
99 
100 
101 #endif // end of guard _CEGuiIrrlichtBaseApplication_h_
void endRendering()
Implementation function to perform required post-render operations.
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
void beginRendering(const float elapsed)
Implementation function to perform required pre-render operations.
Definition: CEGuiIrrlichtBaseApplication.h:58
Definition: cegui/include/CEGUI/RendererModules/Irrlicht/EventPusher.h:37
void checkWindowResize()
member to check and handle resizing of the display window.
void run()
The abstract function for running the application.
CEGUI::Sizef d_lastDisplaySize
size of display last time a change was detected.
Definition: CEGuiIrrlichtBaseApplication.h:97
Base application abstract base class.
Definition: CEGuiBaseApplication.h:69
void destroyWindow()
The abstract function for destroying the renderer and the window.