]>
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_
17 * Fundamental architectural classes.
23 #include <boost/shared_ptr.hpp>
25 #include <moof/event.hh>
26 #include <moof/math.hh>
36 typedef boost::shared_ptr
<view
> view_ptr
;
40 * The core is essentially a stack of layers. While running, it updates
41 * each layer from the bottom up every timestep. It also draws each layer
42 * from the bottom up, adhering to the maximum frame-rate. Events are sent
43 * to each layer from the top down until a layer signals the event was
44 * handled. The core is also responsible for firing timers on time. The
45 * core will continue running as long as there are layers on the stack.
51 // loads settings: rngseed, timestep, framerate, showfps
52 view(moof::settings
& settings
, moof::video
& video
);
57 virtual void did_add_to_view() {}
58 virtual void will_remove_from_view() {}
60 virtual void update(scalar t
, scalar dt
);
61 virtual void draw(scalar alpha
) const;
62 virtual bool handle_event(const event
& event
);
65 void add_child(view_ptr view
);
66 view_ptr
remove_child(view
* view
);
67 view_ptr
remove_child(view_ptr view
);
71 const std::list
<view_ptr
>& children() const;
73 // do not call these without adding the view to a hierarchy with a base
74 // view constructed with settings and a video context
75 moof::settings
& settings() const;
76 moof::video
& video() const;
78 // set this machine in motion
81 bool is_running() const;
87 boost::shared_ptr
<impl
> impl_
;
93 #endif // _MOOF_VIEW_HH_
This page took 0.042314 seconds and 4 git commands to generate.