]>
Dogcows Code - chaz/yoink/blob - src/TitleLayer.cc
d31fe8702bff754e376a9cfd0cdc4d4ca2cd5a00
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/Core.hh>
13 #include <Moof/OpenGL.hh>
14 #include <Moof/Transition.hh>
16 #include "GameLayer.hh"
17 #include "TitleLayer.hh"
20 void TitleLayer::addedToCore()
22 mFadeIn
.init(0.0, 1.0);
25 mGameLayer
= GameLayer::alloc();
28 void TitleLayer::update(Mf::Scalar t
, Mf::Scalar dt
)
30 mFadeIn
.update(t
, dt
);
33 void TitleLayer::draw(Mf::Scalar alpha
) const
35 glClearColor(0.0, 0.0, mFadeIn
.getState(alpha
), 1.0);
36 glClear(GL_COLOR_BUFFER_BIT
);
39 bool TitleLayer::handleEvent(const Mf::Event
& event
)
44 if (event
.key
.keysym
.sym
== SDLK_ESCAPE
)
49 Mf::LayerP titleLayer
= Mf::core
.pop(this);
52 interp
.init(0.0, 1.0);
54 Mf::Transition
<Mf::Lerp
>::Ptr transition
=
55 Mf::Transition
<Mf::Lerp
>::alloc(mGameLayer
, titleLayer
,
57 Mf::core
.push(transition
);
This page took 0.035663 seconds and 4 git commands to generate.