-
Notifications
You must be signed in to change notification settings - Fork 3
/
GzRender.h
44 lines (36 loc) · 1.19 KB
/
GzRender.h
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
42
43
#ifndef GZRENDER_H
#define GZRENDER_H
#include "GzConstants.h"
#include "GzCamera.h"
#include "GzAASetting.h"
#include "GzGeometry.h"
#include "GzLight.h"
#include "GzDisplay.h"
#include <cstdlib>
class GzRender
{
private:
GzDisplay *p_display;
GzCamera *p_camera;
GzLight **p_light_arr; // Array of pointers
int n_lights;
GzGeometry *p_scene; // Union geometry object. Not an array
GzAASetting *p_AA; // By default there will be one AA setting. Can be re-written.
int options;
private:
GzRender(); // Default constructor. Disabled by using private.
public:
GzRender(GzDisplay *p_disp);
~GzRender();
int putCamera(GzCamera *p_cam);
int putLights(GzLight **p_li_arr, int num_lights);
int putScene(GzGeometry *p_sce);
int putAASetting(GzAASetting *p_aa);
int putAttribute(int attribute);
int renderToDisplay();
private:
GzColor shade(const IntersectResult &inter, const GzRay &incRay, float bar);
float getLightCoeff(const GzVector3 &interPos, const GzLight *p_light);
void shadeNonRecurSingleLight(const IntersectResult &inter, const GzRay &incRay, GzLight *p_light, float weight, GzColor &reflectPart, GzColor &diffusePart);
};
#endif