2023-03-12 16:24:48 +01:00
|
|
|
// "Copyright [2023] <Krzysztof Rudnicki>"
|
2023-03-12 17:32:42 +01:00
|
|
|
#ifndef ENGINE_ENGINE_RENDERLOOP_HPP_
|
|
|
|
|
#define ENGINE_ENGINE_RENDERLOOP_HPP_
|
2023-03-14 02:17:42 +01:00
|
|
|
#include <glad/glad.h>
|
2022-09-05 20:17:25 +02:00
|
|
|
#include <GLFW/glfw3.h>
|
2023-03-14 01:56:29 +01:00
|
|
|
|
2022-09-05 20:17:25 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
|
2023-03-29 15:36:08 +02:00
|
|
|
struct drawInput {
|
|
|
|
|
drawInput() : whatToDraw(0), textureOpacity(0) {}
|
|
|
|
|
int whatToDraw;
|
|
|
|
|
float textureOpacity;
|
|
|
|
|
};
|
|
|
|
|
|
2022-09-10 13:40:58 +02:00
|
|
|
void renderLoop(GLFWwindow *window);
|
2023-03-29 15:36:08 +02:00
|
|
|
drawInput renderLoopInside(GLFWwindow *window, drawInput drawData);
|
2023-03-12 17:32:42 +01:00
|
|
|
|
2023-03-14 01:56:29 +01:00
|
|
|
void copyVerticesArray(unsigned int vertexBufferObject, const float vertices[],
|
|
|
|
|
const size_t sizeOfVertices,
|
|
|
|
|
const GLenum boundBufferTarget);
|
2023-03-12 17:32:42 +01:00
|
|
|
|
2022-09-05 20:17:25 +02:00
|
|
|
unsigned int generateBindVAO();
|
2023-03-12 17:32:42 +01:00
|
|
|
|
2023-03-14 01:56:29 +01:00
|
|
|
void configureVertexAttribute(const bool colorIncluded,
|
|
|
|
|
const bool textureIncluded);
|
2023-03-12 17:32:42 +01:00
|
|
|
|
2023-03-29 15:36:08 +02:00
|
|
|
drawInput processInput(GLFWwindow *window, drawInput drawData);
|
2022-09-06 21:52:06 +02:00
|
|
|
|
2023-03-14 01:56:29 +01:00
|
|
|
unsigned int copyVerticesMemory(const float vertices[],
|
|
|
|
|
const size_t sizeOfVertices,
|
|
|
|
|
const GLenum boundBufferTarget);
|
2023-03-12 17:32:42 +01:00
|
|
|
|
2023-03-14 01:56:29 +01:00
|
|
|
unsigned int copyVerticesMemory(const unsigned int vertices[],
|
|
|
|
|
const size_t sizeOfVertices,
|
|
|
|
|
const GLenum boundBufferTarget);
|
2022-09-05 20:17:25 +02:00
|
|
|
|
2023-03-12 17:32:42 +01:00
|
|
|
#endif // ENGINE_ENGINE_RENDERLOOP_HPP_
|