Reputation: 3
Why does the virtual device doesn't present the sprintf? It does open the window and sets the background color, but doesn't present anything else in the window (like the sprintf and g2_string commands).
char str[256];
case'2':
dev=g2_open_X11(750, 500);
d=g2_open_vd();
g2_clear(d);
g2_set_font_size(d, 14);
g2_attach(d, dev);
g2_set_auto_flush(d, 0);
g2_pen(d, 0);
g2_set_background(d, 1);
sprintf(str, "Atitude: %.4f graus", alfa);
g2_string(d, 30, 250, str);
sprintf(str, "Altitude: %.4f m", ht);
g2_string(d, 30, 230, str);
sprintf(str, "Distancia horizontal: %.4f m", xt);
g2_string(d, 30, 210, str);
sprintf(str, "Velocidade em x: %.4f m/s", vxt);
g2_string(d, 30, 190, str);
sprintf(str, "Velocidade em z: %.4f m/s", vzt);
g2_string(d, 30, 170, str);
sprintf(str, "Combustivel: %.4f Kg", m_comb);
g2_string(d, 30, 150, str);
break;
Upvotes: 0
Views: 64