i forgot what i did, but know it works so i will comit to have recent point of return just in casej

parent a5de1545
...@@ -2,11 +2,11 @@ CFLAGS = -Wno-unused-command-line-argument -Wno-missing-field-initializers -Wal ...@@ -2,11 +2,11 @@ CFLAGS = -Wno-unused-command-line-argument -Wno-missing-field-initializers -Wal
OPENMPFLAGS= -fopenmp OPENMPFLAGS= -fopenmp
CLFLAGS= -D CL_TARGET_OPENCL_VERSION=100 -lOpenCL CLFLAGS= -D CL_TARGET_OPENCL_VERSION=100 -lOpenCL
DEBUG_CFLAGS = -g -DDEBUG -pg -O0 #DEBUG_CFLAGS = -g -DDEBUG -pg -O0
LDLIBS = $(shell pkg-config --libs sdl2 SDL2_ttf) LDLIBS = $(shell pkg-config --libs sdl2 SDL2_ttf)
#CFLAGS := $(CFLAGS) -O3 CFLAGS := $(CFLAGS) -O3
CFLAGS := $(CFLAGS) $(DEBUG_CFLAGS) $(CLFLAGS) $(OPENMPFLAGS) CFLAGS := $(CFLAGS) $(DEBUG_CFLAGS) $(CLFLAGS) $(OPENMPFLAGS)
SRCDIR=src SRCDIR=src
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <complex.h> #include <complex.h>
#include <CL/cl.h> #include <CL/cl.h>
//#include <omp.h> #include <omp.h>
#include "mandelbrot.h" #include "mandelbrot.h"
#include "mouse.h" #include "mouse.h"
...@@ -46,7 +46,6 @@ typedef struct { ...@@ -46,7 +46,6 @@ typedef struct {
void void
calculate_set(Array *arr, int height, int width, ViewInfo view) calculate_set(Array *arr, int height, int width, ViewInfo view)
{ {
//printf("arr size: %d, screen %d\n", arr->size, height * width);
#pragma omp parallel for schedule(guided) #pragma omp parallel for schedule(guided)
for (int x = 0; x < width; x++) { for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) { for (int y = 0; y < height; y++) {
...@@ -62,10 +61,11 @@ calculate_set(Array *arr, int height, int width, ViewInfo view) ...@@ -62,10 +61,11 @@ calculate_set(Array *arr, int height, int width, ViewInfo view)
arr->pointer[x * height + y].b = 0; arr->pointer[x * height + y].b = 0;
} else { } else {
double t = (double)iterations / MAX_ITERATIONS; double t = (double)iterations / MAX_ITERATIONS;
t = 0.5 + 0.5 * cos(log(t + 0.0001) * 3.0); t = 0.5 + 0.5 * tan(log(t + 0.0001) * 3.0);
arr->pointer[x * height + y].r = 255 * t;
arr->pointer[x * height + y].r = 255 * t * 0.5;
arr->pointer[x * height + y].g = 255 * t * 0.4; arr->pointer[x * height + y].g = 255 * t * 0.4;
arr->pointer[x * height + y].b = 255 * t * 0.2; arr->pointer[x * height + y].b = 255 * t;
} }
} }
} }
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
#define SCREEN_WIDTH 640 #define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480 #define SCREEN_HEIGHT 480
#define MAX_ITERATIONS 200 #define MAX_ITERATIONS 250
#define FRAMES_TO_CALCULATE_FPS 10
typedef struct { typedef struct {
double real; double real;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment