double width = alloc.width;
double height = alloc.height;
double ang = atan((height/2)/FOV_DIST)*2;
- double atmos = 100000;
- double near = MAX(elev*0.75 - atmos, 50); // View 100km of atmosphere
- double far = elev + 2*EARTH_R + atmos; // on both sides of the earth
+ double atmos = 10000;
+ double near = MAX(elev*0.75 - atmos, 50); // View 100km of atmosphere
+ double far = elev + EARTH_R*1.25 + atmos; // a bit past the cenrt of the earth
glViewport(0, 0, width, height);
gluPerspective(rad2deg(ang), width/height, near, far);
/* Connect signals and idle functions now that opengl is fully initialized */
gtk_widget_add_events(GTK_WIDGET(opengl), GDK_KEY_PRESS_MASK);
g_signal_connect(opengl, "configure-event", G_CALLBACK(_set_projection), NULL);
+#if GTK_CHECK_VERSION(3,0,0)
+ g_signal_connect(opengl, "draw", G_CALLBACK(on_expose), NULL);
+#else
g_signal_connect(opengl, "expose-event", G_CALLBACK(on_expose), NULL);
+#endif
g_signal_connect(opengl, "key-press-event", G_CALLBACK(on_key_press), NULL);