]> git.tdb.fi Git - libs/demoscene.git/blobdiff - source/beatcounter.cpp
Allow setting matrix for the beat counter
[libs/demoscene.git] / source / beatcounter.cpp
index e984034966b000158593ed9bc2407667ecb65966..2798056753d5f4b9810c733cb6957ad446f8442a 100644 (file)
@@ -1,14 +1,19 @@
 #include <msp/strings/format.h>
 #include "beatcounter.h"
 
-using namespace Msp;
+namespace Msp {
+namespace DemoScene {
 
 BeatCounter::BeatCounter(Resources &resources):
        text(resources.get_ui_font(), &resources.get_ui_text_technique()),
        instance(text)
 {
        text.set_alignment(GL::Text::CENTER);
-       instance.set_matrix(GL::Matrix::scaling(0.02f));
+}
+
+void BeatCounter::set_matrix(const GL::Matrix &m)
+{
+       instance.set_matrix(m);
 }
 
 void BeatCounter::beat(int b)
@@ -20,3 +25,6 @@ void BeatCounter::render(GL::Renderer &renderer, const GL::Tag &tag) const
 {
        instance.render(renderer, tag);
 }
+
+} // namespace DemoScene
+} // namespace Msp