aboutsummaryrefslogtreecommitdiff
path: root/graphics.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-09-22 11:44:30 +0200
committerCharles <sircharlesaze@gmail.com>2019-09-22 11:44:30 +0200
commitc5008a4e62fb83eb71f5f94f622c01f2d8fe8b6b (patch)
tree02d1f84aca29c95e999156848a86d61c292b7208 /graphics.c
parent5efde1e3e65af769cb629d55f0a4dd4f87caebe9 (diff)
downloadmandelbrot-c5008a4e62fb83eb71f5f94f622c01f2d8fe8b6b.tar.gz
mandelbrot-c5008a4e62fb83eb71f5f94f622c01f2d8fe8b6b.tar.bz2
mandelbrot-c5008a4e62fb83eb71f5f94f622c01f2d8fe8b6b.zip
Supersampling
- Random supersampling (prettier but quite slow) - WIP: bette color gradient
Diffstat (limited to 'graphics.c')
-rw-r--r--graphics.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/graphics.c b/graphics.c
index d8c6997..e422071 100644
--- a/graphics.c
+++ b/graphics.c
@@ -17,6 +17,8 @@
#define IN_SET_COLOR 0x050505
#define PALETTE_START 0x000022
#define PALETTE_END 0xd62f2f
+/* #define PALETTE_START 0x000000 */
+/* #define PALETTE_END 0xffffff */
#define SET_DRAW_COLOR(renderer, c) ( \
SDL_SetRenderDrawColor(renderer, c.rgb.r, c.rgb.g, c.rgb.b, SDL_ALPHA_OPAQUE));
@@ -185,7 +187,7 @@ static void event_handler(GState *state)
zoom_out(state, ZOOM_RATIO);
break;
case SDL_MOUSEBUTTONDOWN:
- printf("> %d, %d\n", e.button.x, e.button.y);
+ /* printf("> %d, %d\n", e.button.x, e.button.y); */
if (e.button.button == SDL_BUTTON_RIGHT)
recenter(state, e.button.x, e.button.y);
// TODO
@@ -222,6 +224,8 @@ static void event_handler(GState *state)
return NULL;
for (int i = 0; i < MAX_ITERATION; i++)
{
+ /* palette[i] = helper_HSL_to_RGB(i, 0.6, 1.0); */
+ /* printf("%x\n", palette[i].hexcode); */
palette[i].rgb.r = i * red_step + start.rgb.r;
palette[i].rgb.g = i * green_step + start.rgb.g;
palette[i].rgb.b = i * blue_step + start.rgb.b;