Привязка текстуры к модели

This commit is contained in:
2022-11-14 19:47:54 +03:00
parent 86f85229b5
commit c4b60ac552
4 changed files with 26 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
#define MODEL_H
#include "Buffers.h"
#include "Texture.h"
#include <GLM/glm.hpp>
#include <GLM/gtc/quaternion.hpp>
@@ -65,6 +66,7 @@ class Model : public Node
void load_indices(GLuint* indices, GLuint count); // Загрузка индексов в буфер
void load_texCoords(glm::vec2* texCoords, GLuint count); // Загрузка текстурных координат в буфер
void set_index_range(size_t first_byteOffset, size_t count); // Ограничение диапазона из буфера индексов
void set_texture(Texture& texture); // Привязка текстуры к модели
private:
VAO vao;
@@ -72,6 +74,7 @@ class Model : public Node
BO texCoords_vbo; // буфер с текстурными координатами
GLuint verteces_count; // Количество вершин
size_t first_index_byteOffset, indices_count; // Сдвиг в байтах для первого и количество индексов
Texture texture_diffuse; // Диффузная текстура
};
#endif // MODEL_H