aboutsummaryrefslogtreecommitdiff
path: root/src/event.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-05-20 07:41:03 +0200
committerCharles <sircharlesaze@gmail.com>2020-05-20 07:41:03 +0200
commit09a819b2ef927adf5239a73f91cdfcefd6774688 (patch)
tree8602814faa153aae01acc95a557d45b24c028f3b /src/event.c
parent70bf7ac330545f14ab9babddfdf0cb5df9e9ee69 (diff)
downloadmandelbrot-09a819b2ef927adf5239a73f91cdfcefd6774688.tar.gz
mandelbrot-09a819b2ef927adf5239a73f91cdfcefd6774688.tar.bz2
mandelbrot-09a819b2ef927adf5239a73f91cdfcefd6774688.zip
Added colors with 1D texture
Diffstat (limited to 'src/event.c')
-rw-r--r--src/event.c17
1 files changed, 8 insertions, 9 deletions
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;
}