bld.end();
}
+void Port::add_activity(unsigned bytes)
+{
+ activity.add_bytes(bytes);
+}
+
+void Port::tick(const Time::TimeDelta &dt)
+{
+ activity.tick(dt);
+}
+
void Port::render() const
{
GL::PushMatrix push_;
mesh.draw();
+ {
+ GL::Immediate imm((GL::COLOR4_UBYTE, GL::VERTEX2));
+ imm.begin(GL::QUADS);
+ imm.color(color.r, color.g, color.b, color.a);
+ unsigned x = static_cast<unsigned>(activity.get_average()/4096);
+ imm.vertex(14, 0);
+ imm.vertex(14+x, 0);
+ imm.vertex(14+x, 10);
+ imm.vertex(14, 10);
+ imm.end();
+ }
GL::translate(16, 1, 0);
GL::scale_uniform(10);
- GL::Immediate imm((GL::COLOR4_UBYTE, GL::TEXCOORD2, GL::VERTEX2));
- netvis.get_font().draw_string(name, imm);
+ {
+ GL::Immediate imm((GL::COLOR4_UBYTE, GL::TEXCOORD2, GL::VERTEX2));
+ netvis.get_font().draw_string(name, imm);
+ }
GL::Texture::unbind();
}