]> Dogcows Code - chaz/yoink/blob - src/GameLayer.hh
mesh and other random adjustments
[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 projection();
65 void projection(moof::scalar width, moof::scalar height);
66
67 mutable GameState state_;
68
69 HudP mHud;
70
71 moof::sound punch_sound_;
72 moof::sound music_;
73
74 moof::ray2 mRay;
75 moof::line2 mLine;
76 moof::circle mCircle;
77
78 moof::timer mRayTimer;
79 void rayTimer();
80 };
81
82
83 #endif // _GAMELAYER_HH_
84
This page took 0.039943 seconds and 5 git commands to generate.