X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fplugins%2Felev.c;h=6599964cbc1c23aa2a272171138637db824d95ab;hb=7a6093db8586e5cb0625a6092ee8304af900941f;hp=83b2e7bbfe74517fa4fc8e084916fe09f18ee495;hpb=bd716715f1d13a8df514fcfa53fd82aebdfda770;p=grits diff --git a/src/plugins/elev.c b/src/plugins/elev.c index 83b2e7b..6599964 100644 --- a/src/plugins/elev.c +++ b/src/plugins/elev.c @@ -15,6 +15,16 @@ * along with this program. If not, see . */ +/** + * SECTION:elev + * @short_description: Elevation plugin + * + * #GisPluginElev provides access to ground elevation. It does this in two ways: + * First, it provides a height function used by the viewer when drawing the + * world. Second, it can load the elevation data into an image and draw a + * greyscale elevation overlay on the planets surface. + */ + #include #include #include @@ -153,8 +163,8 @@ static guint _load_opengl(GdkPixbuf *pixbuf) (alpha ? GL_RGBA : GL_RGB), GL_UNSIGNED_BYTE, pixels); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); g_debug("GisPluginElev: load_opengl %d", opengl); return opengl; @@ -258,9 +268,24 @@ static void _on_location_changed(GisViewer *viewer, g_thread_create(_update_tiles, elev, FALSE, NULL); } +static gpointer _threaded_init(GisPluginElev *elev) +{ + _load_tile(elev->tiles, elev); + _update_tiles(elev); + return NULL; +} + /*********** * Methods * ***********/ +/** + * gis_plugin_elev_new: + * @viewer: the #GisViewer to use for drawing + * + * Create a new instance of the elevation plugin. + * + * Returns: the new #GisPluginElev + */ GisPluginElev *gis_plugin_elev_new(GisViewer *viewer) { g_debug("GisPluginElev: new"); @@ -268,8 +293,7 @@ GisPluginElev *gis_plugin_elev_new(GisViewer *viewer) elev->viewer = g_object_ref(viewer); /* Load initial tiles */ - _load_tile(elev->tiles, elev); - g_thread_create(_update_tiles, elev, FALSE, NULL); + g_thread_create((GThreadFunc)_threaded_init, elev, FALSE, NULL); /* Connect signals */ elev->sigid = g_signal_connect(elev->viewer, "location-changed",