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
OPENMPFLAGS= -fopenmp
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)
#CFLAGS := $(CFLAGS) -O3
CFLAGS := $(CFLAGS) -O3
CFLAGS := $(CFLAGS) $(DEBUG_CFLAGS) $(CLFLAGS) $(OPENMPFLAGS)
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 @@
#include <SDL2/SDL.h>
#include <complex.h>
#include <CL/cl.h>
//#include <omp.h>
#include <omp.h>
#include "mandelbrot.h"
#include "mouse.h"
......@@ -46,7 +46,6 @@ typedef struct {
void
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)
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
......@@ -62,10 +61,11 @@ calculate_set(Array *arr, int height, int width, ViewInfo view)
arr->pointer[x * height + y].b = 0;
} else {
double t = (double)iterations / MAX_ITERATIONS;
t = 0.5 + 0.5 * cos(log(t + 0.0001) * 3.0);
arr->pointer[x * height + y].r = 255 * t;
t = 0.5 + 0.5 * tan(log(t + 0.0001) * 3.0);
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].b = 255 * t * 0.2;
arr->pointer[x * height + y].b = 255 * t;
}
}
}
......
......@@ -5,8 +5,7 @@
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
#define MAX_ITERATIONS 200
#define FRAMES_TO_CALCULATE_FPS 10
#define MAX_ITERATIONS 250
typedef struct {
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