summaryrefslogtreecommitdiffstats
path: root/src/Render.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-05 15:21:42 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-05 15:21:42 +0200
commitf3e01e3a318fea8d7065468df09e32c1765bfef8 (patch)
tree8840f61192ba65b92912405940f948755305af2e /src/Render.cpp
parentRemoved previous implementation of texture atlas (diff)
downloadAltCraft-f3e01e3a318fea8d7065468df09e32c1765bfef8.tar
AltCraft-f3e01e3a318fea8d7065468df09e32c1765bfef8.tar.gz
AltCraft-f3e01e3a318fea8d7065468df09e32c1765bfef8.tar.bz2
AltCraft-f3e01e3a318fea8d7065468df09e32c1765bfef8.tar.lz
AltCraft-f3e01e3a318fea8d7065468df09e32c1765bfef8.tar.xz
AltCraft-f3e01e3a318fea8d7065468df09e32c1765bfef8.tar.zst
AltCraft-f3e01e3a318fea8d7065468df09e32c1765bfef8.zip
Diffstat (limited to 'src/Render.cpp')
-rw-r--r--src/Render.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Render.cpp b/src/Render.cpp
index 88fe2cc..314840d 100644
--- a/src/Render.cpp
+++ b/src/Render.cpp
@@ -22,6 +22,8 @@ Render::Render(unsigned int windowWidth, unsigned int windowHeight,
glCheckError();
InitGlew();
glCheckError();
+ AssetManager::InitAssetManager();
+ glCheckError();
PrepareToRendering();
glCheckError();
@@ -93,7 +95,7 @@ void Render::InitGlew() {
void Render::PrepareToRendering() {
//TextureAtlas texture
glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D_ARRAY, AssetManager::Instance().GetTextureAtlasId());
+ glBindTexture(GL_TEXTURE_2D_ARRAY, AssetManager::GetTextureAtlasId());
ImGui_ImplSdlGL3_Init(window);
}
@@ -421,7 +423,7 @@ void Render::RenderGui() {
case State::Inventory: {
auto renderSlot = [](const SlotDataType &slot, int i) -> bool {
return ImGui::Button(((slot.BlockId == -1 ? " ##" :
- AssetManager::Instance().GetAssetNameByBlockId(BlockId{ (unsigned short)slot.BlockId,0 }) + " x" + std::to_string(slot.ItemCount) + "##")
+ AssetManager::GetAssetNameByBlockId(BlockId{ (unsigned short)slot.BlockId,0 }) + " x" + std::to_string(slot.ItemCount) + "##")
+ std::to_string(i)).c_str());
};
ImGui::SetNextWindowPosCenter();