volmetrics

changeset 10:8ffa6d61eb56

changed main.cc functions to static :p
author Eleni Maria Stea <elene.mst@gmail.com>
date Sun, 26 Jan 2014 23:18:13 +0200
parents 40febfed6cff
children c5af275b6a60
files src/main.cc
diffstat 1 files changed, 16 insertions(+), 19 deletions(-) [+]
line diff
     1.1 --- a/src/main.cc	Sun Jan 26 23:13:37 2014 +0200
     1.2 +++ b/src/main.cc	Sun Jan 26 23:18:13 2014 +0200
     1.3 @@ -10,14 +10,14 @@
     1.4  #include "mesh.h"
     1.5  #include "volume.h"
     1.6  
     1.7 -bool init(void);
     1.8 -GLUI *create_ui(void);
     1.9 -void display(void);
    1.10 -void reshape(int x, int y);
    1.11 -void keyboard(unsigned char key, int x, int y);
    1.12 -void keyboard_up(unsigned char key, int x, int y);
    1.13 -void mouse(int button, int state, int x, int y);
    1.14 -void motion(int x, int y);
    1.15 +static bool init(void);
    1.16 +static GLUI *create_ui(void);
    1.17 +static void display(void);
    1.18 +static void reshape(int x, int y);
    1.19 +static void keyboard(unsigned char key, int x, int y);
    1.20 +static void keyboard_up(unsigned char key, int x, int y);
    1.21 +static void mouse(int button, int state, int x, int y);
    1.22 +static void motion(int x, int y);
    1.23  
    1.24  static int win_xsz, win_ysz;
    1.25  static float cam_phi, cam_theta, cam_dist = 6;
    1.26 @@ -65,7 +65,7 @@
    1.27  	return 0;
    1.28  }
    1.29  
    1.30 -bool init()
    1.31 +static bool init()
    1.32  {
    1.33  	vol = new Volume;
    1.34  	if(!vol->load("data/test1.vol")) {
    1.35 @@ -87,7 +87,6 @@
    1.36  }
    1.37  
    1.38  static GLUI_Spinner *res_spin[3];
    1.39 -
    1.40  static void toggle_use_orig(int id)
    1.41  {
    1.42  	for(int i=0; i<3; i++) {
    1.43 @@ -98,7 +97,6 @@
    1.44  		}
    1.45  	}
    1.46  }
    1.47 -
    1.48  static void thres_change(int id)
    1.49  {
    1.50  	static float prev_thres = thres;
    1.51 @@ -108,8 +106,7 @@
    1.52  		mesh->clear();
    1.53  	}
    1.54  }
    1.55 -
    1.56 -GLUI *create_ui()
    1.57 +static GLUI *create_ui()
    1.58  {
    1.59  	GLUI *ui = GLUI_Master.create_glui("ui");
    1.60  	assert(ui);
    1.61 @@ -133,7 +130,7 @@
    1.62  	return ui;
    1.63  }
    1.64  
    1.65 -void display(void)
    1.66 +static void display(void)
    1.67  {
    1.68  	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    1.69  
    1.70 @@ -168,7 +165,7 @@
    1.71  	assert(glGetError() == GL_NO_ERROR);
    1.72  }
    1.73  
    1.74 -void reshape(int x, int y)
    1.75 +static void reshape(int x, int y)
    1.76  {
    1.77  	glViewport(0, 0, x, y);
    1.78  	glMatrixMode(GL_PROJECTION);
    1.79 @@ -181,7 +178,7 @@
    1.80  	}
    1.81  }
    1.82  
    1.83 -void keyboard(unsigned char key, int x, int y)
    1.84 +static void keyboard(unsigned char key, int x, int y)
    1.85  {
    1.86  	key_state[(int)key] = true;
    1.87  
    1.88 @@ -201,7 +198,7 @@
    1.89  	}
    1.90  }
    1.91  
    1.92 -void keyboard_up(unsigned char key, int x, int y)
    1.93 +static void keyboard_up(unsigned char key, int x, int y)
    1.94  {
    1.95  	key_state[(int) key] = false;
    1.96  }
    1.97 @@ -210,7 +207,7 @@
    1.98  static bool bn_state[32];
    1.99  static float prev_thres;
   1.100  
   1.101 -void mouse(int bn, int state, int x, int y)
   1.102 +static void mouse(int bn, int state, int x, int y)
   1.103  {
   1.104  	prev_x = x;
   1.105  	prev_y = y;
   1.106 @@ -227,7 +224,7 @@
   1.107  	}
   1.108  }
   1.109  
   1.110 -void motion(int x, int y)
   1.111 +static void motion(int x, int y)
   1.112  {
   1.113  	int dx = x - prev_x;
   1.114  	int dy = y - prev_y;