Added a prepare step to the renderer , removed transform object and GPUBucket object, Added a mesh to the Render3DComponent

The renderer prepare uploads the necessary vertex data to the GPU
This commit is contained in:
2022-10-23 14:02:13 +02:00
parent bc1254e427
commit 99eb5282e5
7 changed files with 60 additions and 132 deletions

View File

@ -1,7 +1,7 @@
#pragma once
#include <glm/glm.hpp>
#include "../Graphics/Primitives/Shader.h"
#include "../Graphics/Primitives/Mesh.h"
namespace BarinkEngine {
struct IdentifierComponent {
std::string name;
@ -19,13 +19,17 @@ namespace BarinkEngine {
};
struct Render3DComponent {
unsigned int VAO;
unsigned int IBO;
unsigned int ElementCount;
unsigned int VAO = 0;
unsigned int IBO = 0;
Mesh mesh;
// TODO: becomes a material
glm::vec3 color;
Shader shader;
Render3DComponent()
: shader(Shader("build/Debug/test.vs", "build/Debug/test.fs") )
: shader(Shader("build/Debug/test.vs", "build/Debug/test.fs")),
color(glm::vec3(1.0f, 0.0f, 0.0f))
{
}
};