summaryrefslogtreecommitdiffstats
path: root/glslview.c
diff options
context:
space:
mode:
Diffstat (limited to 'glslview.c')
-rw-r--r--glslview.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/glslview.c b/glslview.c
index c9a9839..42c9e93 100644
--- a/glslview.c
+++ b/glslview.c
@@ -43,14 +43,6 @@
static float speed = 1.0;
static unsigned previous_ticks = 0;
-static GLint param_k = 0;
-static GLint param_l = 0;
-static GLint param_m = 0;
-
-static GLint param_k_loc;
-static GLint param_l_loc;
-static GLint param_m_loc;
-
#ifdef USE_INOTIFY
@@ -100,20 +92,11 @@ static void check_reload(void) {}
#endif
-void extra_load(GLuint program) {
- param_k_loc = glGetUniformLocation(program, "param_k");
- param_l_loc = glGetUniformLocation(program, "param_l");
- param_m_loc = glGetUniformLocation(program, "param_m");
-}
-
static void update(void) {
unsigned ticks = SDL_GetTicks();
current_time += speed * (ticks - previous_ticks);
previous_ticks = ticks;
- glUniform1i(param_k_loc, param_k);
- glUniform1i(param_l_loc, param_l);
- glUniform1i(param_m_loc, param_m);
}
static void handle_input(const char *input) {
@@ -129,7 +112,7 @@ static void handle_input(const char *input) {
break;
case 'R':
- param_k = param_l = param_m = 0;
+ param0 = param1 = param2 = 0;
break;
case '+':
@@ -191,27 +174,27 @@ int main(int argc, char *argv[]) {
case SDL_KEYDOWN:
switch (e.key.keysym.sym) {
case SDLK_PAGEDOWN:
- param_k++;
+ param0++;
break;
case SDLK_PAGEUP:
- param_k--;
+ param0--;
break;
case SDLK_RIGHT:
- param_l++;
+ param1++;
break;
case SDLK_LEFT:
- param_l--;
+ param1--;
break;
case SDLK_DOWN:
- param_m++;
+ param2++;
break;
case SDLK_UP:
- param_m--;
+ param2--;
break;
case SDLK_ESCAPE: