Browse Source

Use the shader manager singleton in the renderer

master
Riyyi 4 years ago
parent
commit
fafc831d4e
  1. 2
      inferno/src/inferno/render/renderer.cpp
  2. 2
      inferno/src/inferno/render/renderer.h

2
inferno/src/inferno/render/renderer.cpp

@ -75,7 +75,7 @@ namespace Inferno {
// -----------------------------------------
// Create shader
s_quadBatch->shader = std::make_unique<Shader>("assets/glsl/batch-quad");
s_quadBatch->shader = ShaderManager::the().load("assets/glsl/batch-quad");
s_quadBatch->shader->bind();
s_quadBatch->shader->setInt("u_textures", samplers, s_quadBatch->textureUnitPerBatch);
s_quadBatch->shader->unbind();

2
inferno/src/inferno/render/renderer.h

@ -47,7 +47,7 @@ namespace Inferno {
std::array<std::shared_ptr<Texture>, textureUnitPerBatch> textureUnits;
// GPU objects
std::unique_ptr<Shader> shader = nullptr;
std::shared_ptr<Shader> shader = nullptr;
std::shared_ptr<VertexArray> vertexArray = nullptr;
};

Loading…
Cancel
Save