X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FHud.cc;h=b336b28f14a67558698bdc52a55de092259d8998;hp=ea0dfeaef564202a32af2e569fa847501d7354a8;hb=a4debfe4a5f5d339410788971b698ba00cb7f09c;hpb=bfa6212d09d8735d8fd5e2638188e4a99f21ada4 diff --git a/src/Hud.cc b/src/Hud.cc index ea0dfea..b336b28 100644 --- a/src/Hud.cc +++ b/src/Hud.cc @@ -129,10 +129,10 @@ Hud::Hud() : void Hud::resize(int width, int height) { - cml::matrix_orthographic_RH( projection_, - 0.0, - Mf::Scalar(width), 0.0, Mf::Scalar(height), - 1.0, -1.0, cml::z_clip_neg_one); + cml::matrix_orthographic_RH(projection_, + SCALAR(0.0), + Mf::Scalar(width), SCALAR(0.0), Mf::Scalar(height), + SCALAR(1.0), SCALAR(-1.0), cml::z_clip_neg_one); // position the two progress bars at the top-left of the screen bar1_.resize(Mf::Rectangle(20, height - 51, @@ -171,6 +171,18 @@ void Hud::draw(Mf::Scalar alpha) const glPopMatrix(); } +bool Hud::handleEvent(Mf::Event& event) +{ + switch (event.type) + { + case SDL_VIDEORESIZE: + resize(event.resize.w, event.resize.h); + break; + } + + return false; +} + /** vim: set ts=4 sw=4 tw=80: *************************************************/