summary refs log tree commit diff
path: root/minic
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-11-16 23:06:56 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-11-16 23:07:03 -0500
commit2ea517ed26e3f1adf84268648cd028efd6825e52 (patch)
tree77f5cef28609dd60ef3336f0b1b1b258fcd33966 /minic
parent41ba9c89b071fbc9097daaa6810a6abe2ba5085b (diff)
downloadroux-2ea517ed26e3f1adf84268648cd028efd6825e52.tar.gz
tweak colors and sizes in mandelbrot
Diffstat (limited to 'minic')
-rw-r--r--minic/test/mandel.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/minic/test/mandel.c b/minic/test/mandel.c
index a310cf8..68049a3 100644
--- a/minic/test/mandel.c
+++ b/minic/test/mandel.c
@@ -1,6 +1,15 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <SDL2/SDL.h>
+void *malloc();
+void *SDL_CreateWindow();
+void *SDL_CreateRenderer();
+int SDL_SetRenderDrawColor();
+int SDL_RenderDrawPoint();
+int SDL_RenderClear();
+int SDL_RenderPresent();
+int SDL_PollEvent();
+int SDL_DestroyRenderer();
+int SDL_DestroyWindow();
+int SDL_Quit();
+int SDL_Init();
 
 void *win;
 void *rnd;
@@ -31,8 +40,8 @@ plot(int x, int y)
 		zx = nx;
 		zy = ny;
 	}
-	n = 255 - col[n];
-	SDL_SetRenderDrawColor(rnd, n, 130, n, 255);
+	n = col[n];
+	SDL_SetRenderDrawColor(rnd, 100, n, n, 255);
 	SDL_RenderDrawPoint(rnd, x, y);
 	return 0;
 }
@@ -45,8 +54,8 @@ main() {
 	void *e;
 	int *ie;
 
-	W = 400;
-	H = 400;
+	W = 800;
+	H = 800;
 	SDL_Init(32);
 	win = SDL_CreateWindow("Mandelbrot MiniC", 0, 0, W, H, 0);
 	rnd = SDL_CreateRenderer(win, -1, 0);
@@ -56,11 +65,9 @@ main() {
 	c = 20;
 	for (n=0; n<200; n++) {
 		col[n] = c;
-		if (c > 255)
-			printf("%d\n", c);
-		c += (255-c)/8;
+		c = c + (255-c)/8;
 	}
-	col[n] = 0;
+	col[n] = 30;
 
 	SDL_RenderClear(rnd);
 	for (x=0; x<W; x++)
@@ -78,5 +85,4 @@ main() {
 	SDL_DestroyRenderer(rnd);
 	SDL_DestroyWindow(win);
 	SDL_Quit();
-	return 0;
 }