diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-14 18:02:27 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-14 18:02:27 (GMT) |
commit | 5a422dac78479f396437b5f9c1e8efbecf2c9b0f (patch) | |
tree | b9910125b40708a3cd496ec46312012350886a7c /Smoke/gtk.c | |
parent | 241bfc64ed6446c295846d5ae635f6ba4e25a666 (diff) | |
download | 2iv35-5a422dac78479f396437b5f9c1e8efbecf2c9b0f.zip 2iv35-5a422dac78479f396437b5f9c1e8efbecf2c9b0f.tar.gz 2iv35-5a422dac78479f396437b5f9c1e8efbecf2c9b0f.tar.bz2 |
latest merge
Diffstat (limited to 'Smoke/gtk.c')
-rw-r--r-- | Smoke/gtk.c | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/Smoke/gtk.c b/Smoke/gtk.c index a44ed8f..030a9bb 100644 --- a/Smoke/gtk.c +++ b/Smoke/gtk.c @@ -48,6 +48,7 @@ #include <rfftw.h> //the numerical simulation FFTW library #include "fluids.h" +#include "palette.h" #include "seedpoint.h" @@ -292,9 +293,9 @@ scroll_event (GtkWidget *widget, //g_print ("%s: \"scroll_event\": ", gtk_widget_get_name (widget)); //if (event->state == GDK_ALT) { if (event->direction == GDK_SCROLL_UP) { - zoom_in(); + zoom_in(30); } else if (event->direction == GDK_SCROLL_DOWN) { - zoom_out(); + zoom_out(30); } return FALSE; @@ -597,6 +598,15 @@ void show_settings(GtkWidget *notebook) } #endif +static gboolean +select_colormap (GtkComboBox *combo, + gpointer data) { + + g_print("combo: %d\n", gtk_combo_box_get_active(combo)); + selectColor(gtk_combo_box_get_active(combo)); +} + + /* * Draw main notebook page */ @@ -662,15 +672,6 @@ GtkWidget *create_main_page(void) return page; } -static gboolean -select_colormap (GtkComboBox *combo, - gpointer data) { - - g_print("combo: %d\n", gtk_combo_box_get_active(combo)); - selectColor(gtk_combo_box_get_active(combo)); -} - - /* * Draw colormap notebook page @@ -861,6 +862,16 @@ GtkWidget *create_stream_tubes_page(void) return page; } +GtkWidget *create_animated_textures_page(void) +{ + int i, max; + GtkWidget *page; + + page = gtk_vbox_new(FALSE, 0); + + return page; +} + /*** *** Creates the simple application window with one *** drawing area that has an OpenGL-capable visual. @@ -1043,6 +1054,14 @@ create_window (GdkGLConfig *glconfig) gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label); + notebook_page_label = gtk_label_new("Animated Textures"); + gtk_widget_show(notebook_page_label); + + notebook_page = create_animated_textures_page(); + gtk_widget_show(notebook_page); + + gtk_notebook_append_page(GTK_NOTEBOOK(settings_notebook), notebook_page, notebook_page_label); + return window; } @@ -1092,6 +1111,9 @@ main (int argc, { GtkWidget *window; GdkGLConfig *glconfig; + int i; + struct color4f colormap; + float value; /* Initialize GTK. */ gtk_init (&argc, &argv); @@ -1110,6 +1132,13 @@ main (int argc, gtk_main (); + printf("Colormap RGB: %lf, %lf, %lf\n", 0.2, 0.44, 0.666); + for (i = 0; i < 200; i++) { + value = (float)((float)i/200); + colormap = set_colormap(0, value, 1.0f); + printf("Colormap RGB: %lf, %lf, %lf\n", colormap.r, colormap.b, colormap.g); + } + return 0; } |