aboutsummaryrefslogtreecommitdiff
path: root/src/render_cpu.h
blob: e40a5ea67d9c776dcb1faec61c0ab91433ae2220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * render_cpu.h
 *
 *  Created on: 25.01.2018
 *      Author: Superleo1810
 */

#ifndef RENDER_CPU_H_
#define RENDER_CPU_H_

#include "defs.h"
#include <stdlib.h>
#include <GL/glut.h>
#define HAVE_STRUCT_TIMESPEC
#include <pthread.h>
#include <time.h>
#include <math.h>
#include "config.h"

#define COORDS(x, y, width) ((y)*(width)+(x))

typedef struct t_args {
	u8 tc;
	u8 tid;
	d64 x_min;
	d64 x_max;
	d64 y_min;
	d64 y_max;
	u32 (*sfunc) (d64, d64, u32);
	u32 *arr;
} ThreadArgs;

config_t *config_cpu;

void init_cpu(config_t *config);
void render_cpu(d64 x_min, d64 y_min, d64 x_max, d64 y_max);
void idle_cpu(void);
void calculate(d64 x_min, d64 y_min, d64 x_max, d64 y_max, u32 (*sfunc) (d64, d64, u32), u32 *arr);
void calculate_t(void *args);

#endif /* RENDER_CPU_H_ */