(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_TO_BORDER);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
g_debug("GisPluginSrtm: load_opengl %d", opengl);
return opengl;
/* Do necessasairy processing */
/* TODO: Lock this and move to thread, can remove self from _load then */
if (LOAD_BIL)
- gis_opengl_set_height_func(self->opengl, tile, _height_func, self, TRUE);
+ gis_viewer_set_height_func(self->viewer, tile, _height_func, self, TRUE);
/* Cleanup unneeded things */
if (!LOAD_BIL)
GisPluginSrtm *self = _self;
g_mutex_lock(self->mutex);
gdouble lat, lon, elev;
- gis_view_get_location(self->view, &lat, &lon, &elev);
+ gis_viewer_get_location(self->viewer, &lat, &lon, &elev);
gis_tile_update(self->tiles,
MAX_RESOLUTION, TILE_WIDTH, TILE_WIDTH,
lat, lon, elev,
/*************
* Callbacks *
*************/
-static void _on_location_changed(GisView *view, gdouble lat, gdouble lon, gdouble elev,
- GisPluginSrtm *self)
+static void _on_location_changed(GisViewer *viewer,
+ gdouble lat, gdouble lon, gdouble elev, GisPluginSrtm *self)
{
g_thread_create(_update_tiles, self, FALSE, NULL);
}
/***********
* Methods *
***********/
-GisPluginSrtm *gis_plugin_srtm_new(GisWorld *world, GisView *view, GisOpenGL *opengl)
+GisPluginSrtm *gis_plugin_srtm_new(GisViewer *viewer)
{
g_debug("GisPluginSrtm: new");
GisPluginSrtm *self = g_object_new(GIS_TYPE_PLUGIN_SRTM, NULL);
- self->view = view;
- self->opengl = opengl;
+ self->viewer = viewer;
/* Load initial tiles */
_load_tile(self->tiles, self);
g_thread_create(_update_tiles, self, FALSE, NULL);
/* Connect signals */
- self->sigid = g_signal_connect(self->view, "location-changed",
+ self->sigid = g_signal_connect(self->viewer, "location-changed",
G_CALLBACK(_on_location_changed), self);
return self;
g_debug("GisPluginSrtm: expose tiles=%p data=%p",
self->tiles, self->tiles->data);
if (LOAD_OPENGL)
- gis_opengl_render_tiles(self->opengl, self->tiles);
+ gis_viewer_render_tiles(self->viewer, self->tiles);
}
g_debug("GisPluginSrtm: dispose");
GisPluginSrtm *self = GIS_PLUGIN_SRTM(gobject);
/* Drop references */
- g_signal_handler_disconnect(self->view, self->sigid);
+ g_signal_handler_disconnect(self->viewer, self->sigid);
if (LOAD_BIL)
- gis_opengl_clear_height_func(self->opengl);
+ gis_viewer_clear_height_func(self->viewer);
G_OBJECT_CLASS(gis_plugin_srtm_parent_class)->dispose(gobject);
}
static void gis_plugin_srtm_finalize(GObject *gobject)