]>
Dogcows Code - chaz/yoink/blob - src/TitleLayer.cc
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::didAddToView()
20 mFadeIn
.init(0.0, 1.0);
23 //mGameLayer = GameLayer::alloc();
26 void TitleLayer::update(Mf::Scalar t
, Mf::Scalar dt
)
28 mFadeIn
.update(t
, dt
);
29 Mf::View::update(t
, dt
);
32 void TitleLayer::draw(Mf::Scalar alpha
) const
34 glClearColor(0.0, 0.0, mFadeIn
.getState(alpha
), 1.0);
35 glClear(GL_COLOR_BUFFER_BIT
);
36 Mf::View::draw(alpha
);
39 bool TitleLayer::handleEvent(const Mf::Event
& event
)
41 if (Mf::View::handleEvent(event
)) return true;
46 if (event
.key
.keysym
.sym
== SDLK_ESCAPE
)
48 parent().removeChild(this);
52 mGameLayer
= GameLayer::alloc();
53 parent().addChild(mGameLayer
);
55 parent().removeChild(this);
57 //Mf::Lerp interp(0.1);
58 //interp.init(0.0, 1.0);
60 //Mf::Transition<Mf::Lerp>::Ptr transition =
61 //Mf::Transition<Mf::Lerp>::alloc(mGameLayer, titleLayer,
This page took 0.040444 seconds and 4 git commands to generate.