-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader.h
53 lines (30 loc) · 1016 Bytes
/
loader.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
#ifndef LOADER_H
#define LOADER_H
#include <vector>
#include <glad/glad.h>
#include "TextureData.hpp"
#include "intList.hpp"
#include "rawModel.h"
#include "stb_image.h"
#include <string>
#include <iostream>
// Loading 3D Model in GPU Memmory.
class Loader {
public:
IntList* vbos;
IntList* vaos;
IntList* textures;
Loader();
RawModel loadToVAO(std::vector<float> positions, std::vector<unsigned int> indices, std::vector<float> textureCoords, std::vector<float> normals);
unsigned int loadTexture(const char* filePath, bool okreni);
std::vector<TextureData> decodeTextureFile(std::vector<std::string> filePaths);
private:
GLuint createVAO();
void storeDataInAttributeList(int attributeNumber, int coordinateSize, std::vector<float> data);
void unbindVAO();
// Load up Indices Buffers and Bind to VAO
void bindIndicesBuffer( std::vector<unsigned int> indices);
// Clean All VBOs and VAOs from Lists
void cleanUp();
};
#endif // LOADER_H