2023-03-12 16:24:48 +01:00
|
|
|
// "Copyright [2023] <Krzysztof Rudnicki>"
|
2023-03-12 17:32:42 +01:00
|
|
|
#ifndef ENGINE_ENGINE_DRAW_HPP_
|
|
|
|
|
#define ENGINE_ENGINE_DRAW_HPP_
|
2023-03-14 01:56:29 +01:00
|
|
|
#include <glad/glad.h>
|
2023-03-14 02:17:42 +01:00
|
|
|
#include <GLFW/glfw3.h>
|
2023-03-14 01:56:29 +01:00
|
|
|
|
2022-11-20 23:14:59 +01:00
|
|
|
#include <string>
|
2023-03-19 16:59:13 +01:00
|
|
|
#include <vector>
|
2023-03-14 01:56:29 +01:00
|
|
|
|
2023-03-12 17:32:42 +01:00
|
|
|
#include "./constants.hpp"
|
2023-03-19 16:59:13 +01:00
|
|
|
#include "./textures.hpp"
|
2022-09-05 20:17:25 +02:00
|
|
|
|
2023-01-27 21:29:04 +01:00
|
|
|
struct offsetsStruct {
|
2023-03-14 01:56:29 +01:00
|
|
|
offsetsStruct() : xOffset(0), yOffset(0), zOffset(0) {}
|
|
|
|
|
float xOffset, yOffset, zOffset;
|
2023-01-27 21:29:04 +01:00
|
|
|
};
|
|
|
|
|
|
2023-03-11 19:08:15 +01:00
|
|
|
struct drawFigureReturn {
|
2023-03-14 01:56:29 +01:00
|
|
|
drawFigureReturn() : success(-1), VAO(0), VBO(0), EBO(0) {}
|
|
|
|
|
int success;
|
|
|
|
|
unsigned int VAO;
|
|
|
|
|
unsigned int VBO;
|
|
|
|
|
unsigned int EBO;
|
2023-03-11 19:08:15 +01:00
|
|
|
};
|
|
|
|
|
|
2023-03-19 16:59:13 +01:00
|
|
|
|
|
|
|
|
|
2023-03-11 19:08:15 +01:00
|
|
|
drawFigureReturn drawFigure(const int whatToDraw);
|
2023-03-12 17:32:42 +01:00
|
|
|
|
2023-03-14 01:56:29 +01:00
|
|
|
void updateUniformColor(const unsigned int shaderProgram,
|
2023-03-19 17:50:43 +01:00
|
|
|
const std::string uniformName);
|
2023-03-12 17:32:42 +01:00
|
|
|
|
2023-03-19 13:53:13 +01:00
|
|
|
drawFigureReturn draw(
|
2023-03-14 01:56:29 +01:00
|
|
|
const char* vertexPath = constants::VERTEX_SHADER_SOURCE_FILENAME,
|
|
|
|
|
const char* fragmentPath = constants::FRAGMENT_SHADER_SOURCE_FILENAME,
|
|
|
|
|
const float vertices[] = constants::TRIANGLE_VERTICES,
|
|
|
|
|
const size_t verticesSize = constants::TRIANGLE_VERTICES_SIZE,
|
2023-03-19 13:53:13 +01:00
|
|
|
const unsigned int indices[] = constants::TRIANGLE_INDICES,
|
|
|
|
|
const size_t indicesSize = constants::TRIANGLE_INDICES_SIZE,
|
|
|
|
|
const bool colorIncluded = false,
|
|
|
|
|
const bool textureIncluded = false,
|
2023-03-19 16:59:13 +01:00
|
|
|
std::vector<textureArgument> textureInfo = {},
|
2023-03-19 17:50:43 +01:00
|
|
|
const offsetsStruct offsets = offsetsStruct(),
|
|
|
|
|
const std::vector<std::string> uniformName = {}
|
2023-03-19 16:59:13 +01:00
|
|
|
);
|
2023-03-12 17:32:42 +01:00
|
|
|
|
|
|
|
|
#endif // ENGINE_ENGINE_DRAW_HPP_
|