]>
Dogcows Code - chaz/yoink/blob - src/Moof/View.hh
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
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.
10 **************************************************************************/
12 #ifndef _MOOF_VIEW_HH_
13 #define _MOOF_VIEW_HH_
18 #include <boost/shared_ptr.hpp>
20 #include <Moof/Event.hh>
21 #include <Moof/Math.hh>
31 typedef boost::shared_ptr
<View
> ViewP
;
34 * The core is essentially a stack of layers. While running, it updates
35 * each layer from the bottom up every timestep. It also draws each layer
36 * from the bottom up, adhering to the maximum frame-rate. Events are sent
37 * to each layer from the top down until a layer signals the event was
38 * handled. The core is also responsible for firing timers on time. The
39 * core will continue running as long as there are layers on the stack.
46 // loads settings: rngseed, timestep, framerate, showfps
47 View(Settings
& settings
, Video
& video
);
52 virtual void didAddToView() {}
53 virtual void willRemoveFromView() {}
55 virtual void update(Scalar t
, Scalar dt
);
56 virtual void draw(Scalar alpha
) const;
57 virtual bool handleEvent(const Event
& event
);
60 void addChild(ViewP view
);
61 ViewP
removeChild(View
* view
);
62 ViewP
removeChild(ViewP view
);
66 const std::list
<ViewP
>& children() const;
68 // do not call these without adding the view to a hierarchy with a base
69 // view constructed with settings and a video context
70 Settings
& settings() const;
73 // set this machine in motion
76 bool isRunning() const;
81 boost::shared_ptr
<Impl
> mImpl
;
87 #endif // _MOOF_VIEW_HH_
This page took 0.035844 seconds and 4 git commands to generate.