font(0),
max_hosts(1000),
max_visible_hosts(30),
- draw_labels(true),
- blend(true),
frames(0)
{
if(argc<2)
wnd = new Graphics::SimpleGLWindow(1024, 768);
wnd->set_title("NetVis");
wnd->signal_close.connect(sigc::bind(sigc::mem_fun(this, &NetVis::exit), 0));
- wnd->signal_key_press.connect(sigc::mem_fun(this, &NetVis::key_press));
wnd->show();
GL::enable(GL::BLEND);
return *port;
}
-void NetVis::key_press(unsigned key, unsigned, wchar_t)
-{
- if(key==46)
- draw_labels = !draw_labels;
- else if(key==56)
- {
- blend = !blend;
- GL::set(GL_BLEND, blend);
- }
-}
-
void NetVis::capture_handler(unsigned char *user, const pcap_pkthdr *, const unsigned char *data)
{
NetVis *self = reinterpret_cast<NetVis *>(user);