diff --git a/src/main.cc b/src/main.cc index 370adb8..d22c69c 100644 --- a/src/main.cc +++ b/src/main.cc @@ -42,6 +42,7 @@ struct App { // OpenGL refers to as element, hence the name Element Buffer Object GLuint ebo; + float offset_modifier; // offset value passed to shaders as uniform float offset; // offset uniform index @@ -119,6 +120,8 @@ int init(App &app) { glGetString(GL_SHADING_LANGUAGE_VERSION) ); + app.offset_modifier = 0.02f; + return EXIT_CODE_SUCCESS; } @@ -216,9 +219,9 @@ void run_main_loop(App &app) { break; case SDL_KEYDOWN: if (app.event.key.keysym.sym == SDLK_UP) { - app.offset += 0.01f; + app.offset += app.offset_modifier; } else if (app.event.key.keysym.sym == SDLK_DOWN) { - app.offset -= 0.01f; + app.offset -= app.offset_modifier; } } }