summaryrefslogtreecommitdiffstats
path: root/src/RendererSection.hpp
blob: 9bb55e38088b13910b50fe42b063e44cdeae2d9d (plain) (blame)
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
#pragma once

#include <glm/mat4x4.hpp>
#include <GL/glew.h>

#include "Vector.hpp"

class RenderState;
class RendererSectionData;

class RendererSection {
    enum Vbos {
        POSITIONS = 0,
        UVS,
		UVLAYERS,
        ANIMATIONS,
        COLORS,
        LIGHTS,
        VBOCOUNT,
    };
    GLuint Vao = { 0 };
    GLuint Vbo[VBOCOUNT] = { 0 };
	
	size_t hash;
    Vector sectionPos;

    RendererSection(const RendererSection &other) = delete;
public:
    RendererSection(const RendererSectionData &data);

    RendererSection(RendererSection &&other);

	~RendererSection();

	void Render(RenderState &renderState);

    Vector GetPosition();

    size_t GetHash();

    size_t numOfFaces;

    friend void swap(RendererSection &lhs, RendererSection &rhs);

	void UpdateData(const RendererSectionData &data);
};