Skip to content

Commit

Permalink
Added groups
Browse files Browse the repository at this point in the history
  • Loading branch information
denis authored and denis committed Dec 8, 2024
1 parent 82deac1 commit b992773
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Engine/src/Containers/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bool Prisma::Texture::loadTexture(const Parameters& parameters)
m_id = textureID;
}

TextureInfo::getInstance().add(*this);
TextureInfo::getInstance().add({textureID, m_parameters.texture});

GarbageCollector::getInstance().addTexture({textureID, m_id});
return true;
Expand Down
2 changes: 2 additions & 0 deletions GUI/include/TextureInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace Prisma

void add(Prisma::Texture id);

void add(std::pair<unsigned int, std::string> id);

private:
std::vector<Prisma::Texture> m_textures;
};
Expand Down
11 changes: 11 additions & 0 deletions GUI/src/TextureInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <algorithm>

#include "GL/glew.h"

Prisma::TextureInfo::TextureInfo()
{
}
Expand All @@ -11,6 +13,7 @@ void Prisma::TextureInfo::showTextures()
constexpr int numColumns = 5;
ImGui::Columns(numColumns, nullptr, false);
int scale = 10;

// Display the images in a grid layout
for (auto texture : m_textures)
{
Expand All @@ -32,3 +35,11 @@ void Prisma::TextureInfo::add(Prisma::Texture id)
{
m_textures.push_back(id);
}

void Prisma::TextureInfo::add(std::pair<unsigned int, std::string> id)
{
Texture texture;
texture.id(id.first);
texture.name(id.second);
m_textures.push_back(texture);
}

0 comments on commit b992773

Please sign in to comment.