boost::bind(&YoinkApp::contextRecreated, this, _1), this);
setupGL();
+ Mf::Scalar fade[2] = {0.0, 1.0};
+ musicFade.init(fade, 0.0);
music.play();
state = 0.0;
//glLineWidth(10.0f);
}
-void YoinkApp::contextRecreated(const Mf::Notification& note)
+void YoinkApp::contextRecreated(const Mf::Notification* note)
{
// Whenever the context and a new one created, it probably won't contain our
// state so we need to set that up again.
void YoinkApp::update(Mf::Scalar t, Mf::Scalar dt)
{
//dt *= 0.2;
+
+ musicFade.update(dt);
+ music.update(t, dt);
+ music.setGain(musicFade.getValue());
fadeIn.update(dt);
{
testScene->refresh();
}
+ else if (event.key.keysym.sym == SDLK_p)
+ {
+ music.togglePlayPause();
+ }
else if (event.key.keysym.sym == SDLK_l)
{
getVideo().toggleCursorGrab();
case SDL_MOUSEMOTION:
case SDL_MOUSEBUTTONDOWN:
- camera.adjustFromInput(event);
+ camera.handleEvent(event);
break;
case SDL_QUIT: