]>
Dogcows Code - chaz/yoink/blob - src/TitleLayer.cc
92484d0c3c7afdaffa5b2ce58ca814136249888e
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 #include <moof/opengl.hh>
14 #include "GameLayer.hh"
15 #include "TitleLayer.hh"
18 void TitleLayer::did_add_to_view()
20 mFadeIn
.init(0.0, 1.0, 0.15);
22 //mGameLayer = GameLayer::alloc();
25 void TitleLayer::update(moof::scalar t
, moof::scalar dt
)
27 mFadeIn
.update(t
, dt
);
28 moof::view::update(t
, dt
);
31 void TitleLayer::draw(moof::scalar alpha
) const
33 glClearColor(mFadeIn
.state(alpha
), 0.0, mFadeIn
.state(alpha
), 1.0);
34 glClear(GL_COLOR_BUFFER_BIT
);
35 moof::view::draw(alpha
);
38 bool TitleLayer::handle_event(const moof::event
& event
)
40 if (moof::view::handle_event(event
)) return true;
45 if (event
.key
.keysym
.sym
== SDLK_ESCAPE
)
51 mGameLayer
= GameLayer::alloc();
52 parent().add_child(mGameLayer
);
54 parent().remove_child(this);
56 //moof::lerp_scalar interp(0.1);
57 //interp.init(0.0, 1.0);
59 //moof::Transition<moof::lerp_scalar>::Ptr transition =
60 //moof::Transition<moof::lerp_scalar>::alloc(mGameLayer, titleLayer,
This page took 0.034786 seconds and 4 git commands to generate.