]> Dogcows Code - chaz/yoink/blob - src/GameLayer.hh
resource loading bugs and new sound class
[chaz/yoink] / src / GameLayer.hh
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #ifndef _GAMELAYER_HH_
13 #define _GAMELAYER_HH_
14
15 /**
16 * @file GameLayer.hh
17 * This is the big enchilada.
18 */
19
20 #include <iostream>
21 #include <string>
22 #include <vector>
23
24 #include <boost/shared_ptr.hpp>
25
26 #include <moof/math.hh>
27 #include <moof/sound.hh>
28
29 #include <moof/line.hh> // TODO
30 #include <moof/plane.hh>
31 #include <moof/ray.hh>
32 #include <moof/sphere.hh>
33 #include <moof/timer.hh>
34 #include <moof/view.hh>
35
36 #include "GameState.hh"
37 #include "Hud.hh"
38
39
40 class GameLayer;
41 typedef boost::shared_ptr<GameLayer> GameLayerP;
42
43 class GameLayer : public moof::view
44 {
45 public:
46
47 static GameLayerP alloc()
48 {
49 return GameLayerP(new GameLayer);
50 }
51 GameLayer();
52
53 void did_add_to_view();
54
55 void update(moof::scalar t, moof::scalar dt);
56 void draw(moof::scalar alpha) const;
57 bool handle_event(const moof::event& event);
58
59 private:
60
61 void loadSceneLoader();
62 void advanceScene(moof::settings& settings);
63
64 void thinkTimer();
65
66 void projection();
67 void projection(moof::scalar width, moof::scalar height);
68
69 GameState state_;
70 moof::timer mThinkTimer;
71
72 HudP mHud;
73
74 //moof::sound_stream mMusic;
75 moof::sound punch_sound_;
76
77 moof::sound music_;
78
79 moof::ray2 mRay;
80 moof::line2 mLine;
81 moof::circle mCircle;
82
83 moof::timer mRayTimer;
84 void rayTimer();
85 };
86
87
88 #endif // _GAMELAYER_HH_
89
This page took 0.032527 seconds and 4 git commands to generate.