rayfract

view src/gui.cc @ 4:e4349f5804b9

switched to imtk
author John Tsiombikas <nuclear@siggraph.org>
date Fri, 29 Apr 2011 07:30:31 +0300
parents bf1d56975cc9
children 48e0e7d33d9e
line source
1 #include <stdio.h>
3 #ifndef __APPLE__
4 #include <GL/glut.h>
5 #else
6 #include <GLUT/glut.h>
7 #endif
9 #include <imtk.h>
10 #include "gui.h"
11 #include "sdr.h"
12 #include "vmath.h"
15 int xsz, ysz;
16 static int show_gui = 1;
18 extern unsigned int sdr;
19 extern Vector4 seed;
20 extern int iter;
21 extern float err_thres;
22 extern float reflectivity;
24 int gui_init(int width, int height)
25 {
26 xsz = width;
27 ysz = height;
29 imtk_set_viewport(width, height);
31 /*imtk_set_alpha(0.5);*/
32 return 0;
33 }
35 void gui_draw()
36 {
37 if(!show_gui) {
38 return;
39 }
41 imtk_begin();
43 imtk_label("seed x", 10, 20);
44 seed.x = imtk_slider(IMUID, seed.x, -1.0, 1.0, 80, 20);
46 imtk_label("seed y", 10, 50);
47 seed.y = imtk_slider(IMUID, seed.y, -1.0, 1.0, 80, 50);
49 imtk_label("seed z", 10, 80);
50 seed.z = imtk_slider(IMUID, seed.z, -1.0, 1.0, 80, 80);
52 imtk_label("seed w", 10, 110);
53 seed.w = imtk_slider(IMUID, seed.w, -1.0, 1.0, 80, 110);
55 imtk_label("iterations", 10, 140);
56 iter = imtk_slider(IMUID, iter, 0, 32, 80, 140);
58 imtk_label("max error", 10, 170);
59 err_thres = imtk_slider(IMUID, err_thres, 0, 0.075, 80, 170);
61 imtk_label("reflectivity", 280, 20);
62 reflectivity = imtk_slider(IMUID, reflectivity, 0, 1.0, 350, 20);
64 imtk_end();
65 }
67 void gui_set_visible(bool vis)
68 {
69 show_gui = vis;
70 }