forked from Lupus590AtUni/Uni_NetworksAssignment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cRenderClass.h
54 lines (40 loc) · 1.02 KB
/
cRenderClass.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
44
45
46
47
48
49
50
51
52
53
54
#pragma once
//https://msdn.microsoft.com/en-us/library/windows/desktop/ms737629(v=vs.85).aspx
// I think opengl glut may need some window.h stuff, so add this just in case
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <iostream>
#include <tchar.h>
#include "GL/glut.h"
#include "NA_Vector.h"
struct sRGB
{
float r, g, b;
};
class cRenderClass
{
public:
bool mouseIsScary = false;
NA_Vector mousePos;
cRenderClass(const int, const int);
~cRenderClass();
void create(int argc, _TCHAR* argv[]);
void loop();
void clear();
void render();
void setColour(float, float, float);
void setPointSize(int);
void drawPixel(int, int);
private:
int m_sw, m_sh;
int m_point_size;
float *m_buffer;
sRGB m_colour;
};
extern void winReshapeFunc(GLint w, GLint h);
extern void renderScene();
extern void update();
extern void mouse(int x, int y);
extern void click(int button, int state, int x, int y);
extern void key(unsigned char c, int x, int y);