aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/examples/Demo/CDemo.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-03-28 22:28:34 +1000
committerDavid Walter Seikel2016-03-28 22:28:34 +1000
commit7028cbe09c688437910a25623098762bf0fa592d (patch)
tree10b5af58277d9880380c2251f109325542c4e6eb /src/others/irrlicht-1.8.1/examples/Demo/CDemo.h
parentMove lemon to the src/others directory. (diff)
downloadSledjHamr-7028cbe09c688437910a25623098762bf0fa592d.zip
SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.gz
SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.bz2
SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.xz
Move Irrlicht to src/others.
Diffstat (limited to 'src/others/irrlicht-1.8.1/examples/Demo/CDemo.h')
-rw-r--r--src/others/irrlicht-1.8.1/examples/Demo/CDemo.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/examples/Demo/CDemo.h b/src/others/irrlicht-1.8.1/examples/Demo/CDemo.h
new file mode 100644
index 0000000..e2c564d
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/examples/Demo/CDemo.h
@@ -0,0 +1,110 @@
1// This is a Demo of the Irrlicht Engine (c) 2006 by N.Gebhardt.
2// This file is not documented.
3
4#ifndef __C_DEMO_H_INCLUDED__
5#define __C_DEMO_H_INCLUDED__
6
7//#define USE_IRRKLANG
8//#define USE_SDL_MIXER
9
10#include <irrlicht.h>
11
12#ifdef _IRR_WINDOWS_
13#include <windows.h>
14#endif
15
16using namespace irr;
17
18// audio support
19
20#ifdef USE_IRRKLANG
21 #include <irrKlang.h> // problem here? go to http://www.ambiera.com/irrklang and download
22 // the irrKlang library or undefine USE_IRRKLANG at the beginning
23 // of this file.
24 #ifdef _IRR_WINDOWS_
25 #pragma comment (lib, "irrKlang.lib")
26 #endif
27#endif
28#ifdef USE_SDL_MIXER
29 # include <SDL/SDL.h>
30 # include <SDL/SDL_mixer.h>
31#endif
32
33const int CAMERA_COUNT = 7;
34
35class CDemo : public IEventReceiver
36{
37public:
38
39 CDemo(bool fullscreen, bool music, bool shadows, bool additive, bool vsync, bool aa, video::E_DRIVER_TYPE driver);
40
41 ~CDemo();
42
43 void run();
44
45 virtual bool OnEvent(const SEvent& event);
46
47private:
48
49 void createLoadingScreen();
50 void loadSceneData();
51 void switchToNextScene();
52 void shoot();
53 void createParticleImpacts();
54
55 bool fullscreen;
56 bool music;
57 bool shadows;
58 bool additive;
59 bool vsync;
60 bool aa;
61 video::E_DRIVER_TYPE driverType;
62 IrrlichtDevice *device;
63
64#ifdef USE_IRRKLANG
65 void startIrrKlang();
66 irrklang::ISoundEngine* irrKlang;
67 irrklang::ISoundSource* ballSound;
68 irrklang::ISoundSource* impactSound;
69#endif
70
71#ifdef USE_SDL_MIXER
72 void startSound();
73 void playSound(Mix_Chunk *);
74 void pollSound();
75 Mix_Music *stream;
76 Mix_Chunk *ballSound;
77 Mix_Chunk *impactSound;
78#endif
79
80 struct SParticleImpact
81 {
82 u32 when;
83 core::vector3df pos;
84 core::vector3df outVector;
85 };
86
87 int currentScene;
88 video::SColor backColor;
89
90 gui::IGUIStaticText* statusText;
91 gui::IGUIInOutFader* inOutFader;
92
93 scene::IQ3LevelMesh* quakeLevelMesh;
94 scene::ISceneNode* quakeLevelNode;
95 scene::ISceneNode* skyboxNode;
96 scene::IAnimatedMeshSceneNode* model1;
97 scene::IAnimatedMeshSceneNode* model2;
98 scene::IParticleSystemSceneNode* campFire;
99
100 scene::IMetaTriangleSelector* metaSelector;
101 scene::ITriangleSelector* mapSelector;
102
103 s32 sceneStartTime;
104 s32 timeForThisScene;
105
106 core::array<SParticleImpact> Impacts;
107};
108
109#endif
110