X-Git-Url: http://git.tdb.fi/?p=netvis.git;a=blobdiff_plain;f=source%2Fhost.cpp;h=4314d75f63714c01c5a7e3f5f1ac42f9df06c9ae;hp=bd93de190a1e6217bf1f1d7d3b23e7ca7ad80632;hb=42bd2e83d66a98584540dd8cc5b47ee2349fe844;hpb=c147c9caaf9bc2f6323baf188a438ced9f0f5894 diff --git a/source/host.cpp b/source/host.cpp index bd93de1..4314d75 100644 --- a/source/host.cpp +++ b/source/host.cpp @@ -137,10 +137,10 @@ void Host::render() const if(!active) return; - GL::push_matrix(); + GL::PushMatrix push_; GL::translate(static_cast(pos.x), static_cast(pos.y), 0); - GL::Immediate imm((GL::COLOR4_UBYTE, GL::VERTEX2)); + GL::Immediate imm((GL::COLOR4_UBYTE, GL::TEXCOORD2, GL::VERTEX2)); imm.begin(GL::QUADS); imm.color(1.0f, 1.0f, 1.0f, max(min(static_cast(activity/10000), 1.0f), 0.2f)); imm.vertex(-5, -5); @@ -149,23 +149,13 @@ void Host::render() const imm.vertex(-5, 5); imm.end(); - GL::pop_matrix(); -} - -void Host::render_label() const -{ - if(!active) - return; - const GL::Font &font = netvis.get_font(); - - GL::push_matrix(); - GL::translate(static_cast(pos.x)-static_cast(font.get_string_width(short_name)*5), static_cast(pos.y)+6, 0); + GL::translate(-static_cast(font.get_string_width(short_name)*5), 6, 0); GL::scale_uniform(10); - GL::Immediate imm((GL::COLOR4_UBYTE, GL::TEXCOORD2, GL::VERTEX2)); imm.color(1.0f, 1.0f, 1.0f); font.draw_string(short_name, imm); + GL::Texture::unbind(); GL::pop_matrix(); }