]> git.tdb.fi Git - netvis.git/blobdiff - source/history.cpp
Adapt to MSP library changes
[netvis.git] / source / history.cpp
index b3e15f213cc151a18867b04a23825b8f7917b6c6..19f6b34a9d3275662fb44f8c5b793e442966849e 100644 (file)
@@ -10,7 +10,7 @@ Distributed unter the GPL
 #include <msp/gl/matrix.h>
 #include <msp/gl/meshbuilder.h>
 #include <msp/gl/misc.h>
-#include <msp/strings/formatter.h>
+#include <msp/strings/format.h>
 #include <msp/time/units.h>
 #include "history.h"
 #include "netvis.h"
@@ -33,7 +33,7 @@ History::History(NetVis &n, unsigned w, unsigned h):
                for(texw=1; texw<height; texw<<=1) ;
                for(texh=1; texh<width; texh<<=1) ;
        }
-       texture.storage(GL::RGBA, texw, texh, 0);
+       texture.storage(GL::RGBA, texw, texh);
        texture.image(0, GL::RGBA, GL::UNSIGNED_BYTE, 0);
        texture.set_min_filter(GL::LINEAR);
        float wf = static_cast<float>(height)/texw;
@@ -105,16 +105,14 @@ void History::render() const
                value /= 1024;
                suffix = 'M';
        }
-       GL::PushMatrix push_;
-       GL::translate(width+5, height-10, 0);
-       GL::scale_uniform(10);
-       GL::Immediate imm((GL::COLOR4_UBYTE, GL::TEXCOORD2, GL::VERTEX2));
-       imm.color(1.0f, 1.0f, 1.0f);
-       netvis.get_font().draw_string(format("%d%c", value, suffix), imm);
-       GL::translate(0, (height-12)*-0.05, 0);
-       netvis.get_font().draw_string(format("%g%c", value*0.5, suffix), imm);
-       GL::translate(0, (height-12)*-0.05, 0);
-       netvis.get_font().draw_string(format("0%c", suffix), imm);
+       GL::MatrixStack::Push push_(GL::MatrixStack::modelview());
+       GL::MatrixStack::modelview() *= GL::Matrix::translation(width+5, height-10, 0);
+       GL::MatrixStack::modelview() *= GL::Matrix::scaling(10);
+       netvis.get_font().draw_string(format("%d%c", value, suffix));
+       GL::MatrixStack::modelview() *= GL::Matrix::translation(0, (height-12)*-0.05, 0);
+       netvis.get_font().draw_string(format("%g%c", value*0.5, suffix));
+       GL::MatrixStack::modelview() *= GL::Matrix::translation(0, (height-12)*-0.05, 0);
+       netvis.get_font().draw_string(format("0%c", suffix));
        GL::Texture::unbind();
 }