From 09a819b2ef927adf5239a73f91cdfcefd6774688 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 20 May 2020 07:41:03 +0200 Subject: Added colors with 1D texture --- src/event.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/event.c') diff --git a/src/event.c b/src/event.c index 18763b0..6fd6a8c 100644 --- a/src/event.c +++ b/src/event.c @@ -21,13 +21,13 @@ void event_handle(State *state) { case SDLK_r: state->iterations += 10; - /* state->palette = color_palette_new(state->palette, state->iterations); */ + /* state->texture = color_texture_new( state->iterations); */ break; case SDLK_e: state->iterations -= 10; if (state->iterations <= 0) state->iterations = 1; - /* state->palette = color_palette_new(state->palette, state->iterations); */ + /* state->texture = color_texture_new( state->iterations); */ break; case SDLK_UP: case SDLK_k: @@ -68,15 +68,14 @@ void event_handle(State *state) case SDL_WINDOWEVENT: if (e.window.event == SDL_WINDOWEVENT_RESIZED) { + double w_ratio = (double)state->width / (double)e.window.data1; + double h_ratio = (double)state->height / (double)e.window.data2; SDL_GL_GetDrawableSize(state->window, &state->width, &state->height); GL_CALL(glViewport(0, 0, state->width, state->height)); - /* double w_ratio = (double)width / (double)e.window.data1; */ - /* double h_ratio = (double)height / (double)e.window.data2; */ - /* */ - /* state->real_start /= w_ratio; */ - /* state->real_end /= w_ratio; */ - /* state->imag_start /= h_ratio; */ - /* state->imag_end /= h_ratio; */ + state->real_start /= w_ratio; + state->real_end /= w_ratio; + state->imag_start /= h_ratio; + state->imag_end /= h_ratio; } break; } -- cgit