X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=src%2Fplugin-example.c;h=8b6361dcbcebc99f8ea3de7438dfc5ad4296e3ba;hb=41008f10274d097761881ab0fa615cf2881fe02c;hp=bab69c40b6ab87327fc49bb4d4134e8f725d0e2e;hpb=f230908a4780fd954772bbc3d17658aba86baea8;p=grits diff --git a/src/plugin-example.c b/src/plugin-example.c index bab69c4..8b6361d 100644 --- a/src/plugin-example.c +++ b/src/plugin-example.c @@ -1,17 +1,38 @@ +/* + * Copyright (C) 2009 Andy Spencer + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include #include +#include "aweather-gui.h" + static GtkWidget *rotate_button; static float ang = 30.; static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data) { - glPushMatrix(); glDisable(GL_TEXTURE_2D); - glLoadIdentity(); + glMatrixMode(GL_MODELVIEW ); glPushMatrix(); glLoadIdentity(); + glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); + //glOrtho(-1,1,-1,1,-10,10); + glTranslatef(0.5, -0.5, -2); float light_ambient[] = {0.1f, 0.1f, 0.0f}; @@ -34,7 +55,8 @@ static gboolean expose(GtkWidget *da, GdkEventExpose *event, gpointer user_data) glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); - glPopMatrix(); + glMatrixMode(GL_PROJECTION); glPopMatrix(); + glMatrixMode(GL_MODELVIEW ); glPopMatrix(); return FALSE; } @@ -53,8 +75,11 @@ static gboolean rotate(gpointer user_data) return TRUE; } -gboolean example_init(GtkDrawingArea *drawing, GtkNotebook *config) +gboolean example_init(AWeatherGui *gui) { + GtkWidget *drawing = aweather_gui_get_widget(gui, "drawing"); + GtkWidget *config = aweather_gui_get_widget(gui, "tabs"); + /* Add configuration tab */ GtkWidget *label = gtk_label_new("example"); rotate_button = gtk_toggle_button_new_with_label("Rotate");