]> Dogcows Code - chaz/yoink/blob - src/GameLayer.hh
initial mesh testing
[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/mesh.hh>
28 #include <moof/sound.hh>
29
30 #include <moof/line.hh> // TODO
31 #include <moof/plane.hh>
32 #include <moof/ray.hh>
33 #include <moof/sphere.hh>
34 #include <moof/timer.hh>
35 #include <moof/view.hh>
36
37 #include "GameState.hh"
38 #include "Hud.hh"
39
40
41 class GameLayer;
42 typedef boost::shared_ptr<GameLayer> GameLayerP;
43
44 class GameLayer : public moof::view
45 {
46 public:
47
48 static GameLayerP alloc()
49 {
50 return GameLayerP(new GameLayer);
51 }
52 GameLayer();
53
54 void did_add_to_view();
55
56 void update(moof::scalar t, moof::scalar dt);
57 void draw(moof::scalar alpha) const;
58 bool handle_event(const moof::event& event);
59
60 private:
61
62 void loadSceneLoader();
63 void advanceScene(moof::settings& settings);
64
65 void thinkTimer();
66
67 void projection();
68 void projection(moof::scalar width, moof::scalar height);
69
70 GameState state_;
71 moof::timer mThinkTimer;
72
73 HudP mHud;
74
75 //moof::sound_stream mMusic;
76 moof::sound punch_sound_;
77 moof::sound music_;
78
79 moof::mesh_handle sceneMesh;
80
81 moof::ray2 mRay;
82 moof::line2 mLine;
83 moof::circle mCircle;
84
85 moof::timer mRayTimer;
86 void rayTimer();
87 };
88
89
90 #endif // _GAMELAYER_HH_
91
This page took 0.034896 seconds and 5 git commands to generate.