-
Notifications
You must be signed in to change notification settings - Fork 0
/
Map.h
61 lines (44 loc) · 1.08 KB
/
Map.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
55
56
57
// River Raid 2018
// Made by Micha³ Berdzik, AGH, 2018 ©
//------------------------------------------------------------------
#pragma once
#include <SDL.h>
#include <gl/glew.h>
#include <iostream>
#include <math.h>
#include "SFML\System.hpp"
#include "vertexarray.h"
class Map
{
//zmienne ------------------------------------------------------------
public:
bool Loaded = 0;
private:
std::vector<std::vector<float>> heights;
std::vector<std::vector<std::vector<float>>> colormap;
GLuint m_positionBuffer;
GLuint m_vao;
GLuint colorbuffer;
float* positions = NULL;
float* colors = NULL;
int size;
int m_meshResolution;
int p_block;
int p_height;
//metody ------------------------------------------------------------
public:
Map(int,int);
~Map();
void LoadAllThread();
void RenderMap();
void LoadAll();
float GetValue(int x, int y);
void LoadVertex();
private:
void loadHeightmap(const char* name, int step);
void loadColormap(const char* name, int step);
void LoadBuffers(int block, int h);
void LoadPosBuff();
void LoadMapVao();
void LoadColorBuff();
};