engineer-thesis-WUT/Engine/engine/draw.hpp

50 lines
1.4 KiB
C++
Raw Normal View History

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_
#include <glad/glad.h>
2023-03-14 02:17:42 +01:00
#include <GLFW/glfw3.h>
2022-11-20 23:14:59 +01:00
#include <string>
2023-03-19 16:59:13 +01:00
#include <vector>
2023-03-12 17:32:42 +01:00
#include "./constants.hpp"
2023-03-19 16:59:13 +01:00
#include "./textures.hpp"
#include "./renderLoop.hpp"
2022-09-05 20:17:25 +02:00
2023-01-27 21:29:04 +01:00
struct offsetsStruct {
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 {
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
drawFigureReturn drawFigure(const drawInput drawData);
2023-03-12 17:32:42 +01:00
2023-03-29 14:46:58 +02:00
void updateUniformColor(const Shader 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(
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 = {},
const drawInput drawData = drawInput()
2023-03-19 16:59:13 +01:00
);
2023-03-12 17:32:42 +01:00
#endif // ENGINE_ENGINE_DRAW_HPP_