implemented multithreading, but with mutex. will mit atomic operations optimieren
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include <pthread.h>
|
||||
struct vec3 {
|
||||
double x, y, z;
|
||||
};
|
||||
@@ -55,4 +56,20 @@ struct object {
|
||||
|
||||
struct cube {
|
||||
quad quad1,quad2,quad3,quad4,quad5,quad6;
|
||||
}; typedef struct cube cube;
|
||||
}; typedef struct cube cube;
|
||||
|
||||
typedef struct {
|
||||
//int pixelId;
|
||||
object *objectList;
|
||||
int objectCount;
|
||||
int width;
|
||||
int channels;
|
||||
vec3 *screenTopLeft;
|
||||
vec3 *vecPixelStepX;
|
||||
vec3 *vecPixelStepY;
|
||||
camera *cam1;
|
||||
unsigned char **image;
|
||||
int nextPixelId;
|
||||
pthread_mutex_t mutexKey;
|
||||
int pixelCount;
|
||||
} RenderArgs;
|
||||
Reference in New Issue
Block a user