2 * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include <gtk/gtkgl.h>
29 GisPluginTest *gis_plugin_test_new(GisViewer *viewer)
31 g_debug("GisPluginTest: new");
32 GisPluginTest *self = g_object_new(GIS_TYPE_PLUGIN_TEST, NULL);
33 self->viewer = viewer;
37 static void gis_plugin_test_expose(GisPlugin *_self)
39 GisPluginTest *self = GIS_PLUGIN_TEST(_self);
40 g_debug("GisPluginTest: expose");
42 double width = GTK_WIDGET(self->viewer)->allocation.width;
43 double height = GTK_WIDGET(self->viewer)->allocation.height;
49 gis_viewer_project(self->viewer,
50 38.841847, -90.491982, 0, &px, &py, &pz);
53 //cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
54 //cairo_t *cairo = cairo_create(surface);
55 //cairo_set_source_rgba(cairo, 1, 1, 1, 1);
56 //cairo_arc(cairo, px, py, 4, 0, 2*G_PI);
58 //cairo_move_to(cairo, px+4, py-8);
59 //cairo_set_font_size(cairo, 10);
60 //cairo_show_text(cairo, "Marker!");
63 //glEnable(GL_TEXTURE_2D);
64 //glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
65 //glPixelStorei(GL_PACK_ALIGNMENT, 1);
66 //glGenTextures(1, &tex);
67 //glBindTexture(GL_TEXTURE_2D, tex);
68 //glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE,
69 // cairo_image_surface_get_data(surface));
70 //glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
71 //glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
73 //glMatrixMode(GL_PROJECTION);
75 //glMatrixMode(GL_MODELVIEW);
78 //glDisable(GL_COLOR_MATERIAL);
79 //glDisable(GL_CULL_FACE);
80 //glDisable(GL_DEPTH_TEST);
81 //glDisable(GL_LIGHTING);
83 //glTexCoord2d(0, 0); glVertex3f(-1, 1, 1);
84 //glTexCoord2d(1, 0); glVertex3f( 1, 1, 1);
85 //glTexCoord2d(1, 1); glVertex3f( 1, -1, 1);
86 //glTexCoord2d(0, 1); glVertex3f(-1, -1, 1);
88 //glDeleteTextures(1, &tex);
89 //cairo_destroy(cairo);
90 //cairo_surface_destroy(surface);
98 static void gis_plugin_test_plugin_init(GisPluginInterface *iface);
99 G_DEFINE_TYPE_WITH_CODE(GisPluginTest, gis_plugin_test, G_TYPE_OBJECT,
100 G_IMPLEMENT_INTERFACE(GIS_TYPE_PLUGIN,
101 gis_plugin_test_plugin_init));
102 static void gis_plugin_test_plugin_init(GisPluginInterface *iface)
104 g_debug("GisPluginTest: plugin_init");
105 /* Add methods to the interface */
106 iface->expose = gis_plugin_test_expose;
108 /* Class/Object init */
109 static void gis_plugin_test_init(GisPluginTest *self)
111 g_debug("GisPluginTest: init");
113 static void gis_plugin_test_class_init(GisPluginTestClass *klass)
115 g_debug("GisPluginTest: class_init");