*/
#include <time.h>
+#include <string.h>
#include <glib/gstdio.h>
#include <GL/gl.h>
gint width = gdk_pixbuf_get_width(pixbuf);
gint height = gdk_pixbuf_get_height(pixbuf);
+ /* Draw a border */
+ //gint border = 10;
+ //gint stride = gdk_pixbuf_get_rowstride(pixbuf);
+ //for (int i = 0; i < border; i++) {
+ // memset(&pixels[( i)*stride], 0xff, stride);
+ // memset(&pixels[(height-i)*stride], 0xff, stride);
+ //}
+ //for (int i = 0; i < height; i++) {
+ // memset(&pixels[(i*stride)], 0xff, border*4);
+ // memset(&pixels[(i*stride)+((width-border)*4)], 0xff, border*4);
+ //}
+
guint *tex = g_new0(guint, 1);
glGenTextures(1, tex);
glBindTexture(GL_TEXTURE_2D, *tex);
g_thread_create(_update_tiles, sat, FALSE, NULL);
}
+static gpointer _threaded_init(GisPluginSat *sat)
+{
+ _load_tile(sat->tiles, sat);
+ _update_tiles(sat);
+ return NULL;
+}
+
/***********
* Methods *
***********/
sat->viewer = g_object_ref(viewer);
/* Load initial tiles */
- _load_tile(sat->tiles, sat);
- g_thread_create(_update_tiles, sat, FALSE, NULL);
+ g_thread_create((GThreadFunc)_threaded_init, sat, FALSE, NULL);
/* Connect signals */
sat->sigid = g_signal_connect(sat->viewer, "location-changed",