|
|
@ -46,6 +46,7 @@ namespace Inferno { |
|
|
|
textureManager->initialize(); |
|
|
|
textureManager->initialize(); |
|
|
|
|
|
|
|
|
|
|
|
m_scene = std::make_shared<Scene>(); |
|
|
|
m_scene = std::make_shared<Scene>(); |
|
|
|
|
|
|
|
m_scene->initialize(); |
|
|
|
|
|
|
|
|
|
|
|
Renderer2D* renderer2D = new Renderer2D(); |
|
|
|
Renderer2D* renderer2D = new Renderer2D(); |
|
|
|
renderer2D->initialize(); |
|
|
|
renderer2D->initialize(); |
|
|
@ -58,9 +59,6 @@ namespace Inferno { |
|
|
|
|
|
|
|
|
|
|
|
// Load assets
|
|
|
|
// Load assets
|
|
|
|
|
|
|
|
|
|
|
|
m_texture = TextureManager::the().load("assets/gfx/test.png"); |
|
|
|
|
|
|
|
m_texture2 = TextureManager::the().load("assets/gfx/test-inverted.png"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_font = FontManager::the().load("assets/fnt/dejavu-sans"); |
|
|
|
m_font = FontManager::the().load("assets/fnt/dejavu-sans"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -80,19 +78,6 @@ namespace Inferno { |
|
|
|
{ |
|
|
|
{ |
|
|
|
dbg() << "Application startup"; |
|
|
|
dbg() << "Application startup"; |
|
|
|
|
|
|
|
|
|
|
|
Entity quad = m_scene->createEntity("Quad"); |
|
|
|
|
|
|
|
quad.add<SpriteComponent>(glm::vec4 { 1.0f, 1.0f, 1.0f, 1.0f }, m_texture); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Entity quad2 = m_scene->createEntity("Quad 2"); |
|
|
|
|
|
|
|
auto& quad2Transform = quad2.get<TransformComponent>(); |
|
|
|
|
|
|
|
quad2Transform.translate.x = 1.1f; |
|
|
|
|
|
|
|
quad2.add<SpriteComponent>(glm::vec4 { 0.5f, 0.6f, 0.8f, 1.0f }, m_texture); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Entity quad3 = m_scene->createEntity("Quad 3"); |
|
|
|
|
|
|
|
auto& quad3Transform = quad3.get<TransformComponent>(); |
|
|
|
|
|
|
|
quad3Transform.translate.x = 2.2f; |
|
|
|
|
|
|
|
quad3.add<SpriteComponent>(glm::vec4 { 1.0f, 1.0f, 1.0f, 1.0f }, m_texture2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::array<CharacterVertex, Renderer::vertexPerQuad> character; |
|
|
|
std::array<CharacterVertex, Renderer::vertexPerQuad> character; |
|
|
|
|
|
|
|
|
|
|
|
// character.at(0).quad.textureCoordinates = { 0.0f, 0.0f }; // bottom left
|
|
|
|
// character.at(0).quad.textureCoordinates = { 0.0f, 0.0f }; // bottom left
|
|
|
@ -131,11 +116,6 @@ namespace Inferno { |
|
|
|
character.at(2).quad.textureCoordinates = { x.y, y.y }; |
|
|
|
character.at(2).quad.textureCoordinates = { x.y, y.y }; |
|
|
|
character.at(3).quad.textureCoordinates = { x.x, y.y }; |
|
|
|
character.at(3).quad.textureCoordinates = { x.x, y.y }; |
|
|
|
|
|
|
|
|
|
|
|
character.at(0).quad.textureIndex = 1.0f; |
|
|
|
|
|
|
|
character.at(1).quad.textureIndex = 1.0f; |
|
|
|
|
|
|
|
character.at(2).quad.textureIndex = 1.0f; |
|
|
|
|
|
|
|
character.at(3).quad.textureIndex = 1.0f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// pos
|
|
|
|
// pos
|
|
|
|
// texcoords
|
|
|
|
// texcoords
|
|
|
|
//
|
|
|
|
//
|
|
|
|