From 70bf7ac330545f14ab9babddfdf0cb5df9e9ee69 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 19 May 2020 22:45:04 +0200 Subject: Simple (but insanly fast compared to CPU) fragment shader to draw mandelbrot set --- inc/mandel.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/mandel.h b/inc/mandel.h index f55466c..a537f87 100644 --- a/inc/mandel.h +++ b/inc/mandel.h @@ -51,7 +51,15 @@ typedef struct unsigned int id; struct { - int iteration; + int width; + int height; + + float real_start; + float real_end; + float imag_start; + float imag_end; + + int iterations; } location; } Shader; @@ -64,6 +72,7 @@ typedef struct int height; unsigned int vertex_buf; + unsigned int vertex_array; unsigned int texture; Shader shader; @@ -98,5 +107,6 @@ Color *color_palette_new(Color *palette, int iterations); // shader.c bool shader_init(Shader *shader); +void shader_set_uniforms(Shader *shader, State *state); #endif -- cgit