19
src/App.hpp
19
src/App.hpp
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cassert>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
@@ -196,6 +198,23 @@ private:
|
||||
bool surrounding_dirty { false };
|
||||
} m_ime;
|
||||
|
||||
// NOTE: Canonicalize first!
|
||||
std::unordered_map<std::filesystem::path, Texture2D> m_textures;
|
||||
|
||||
auto get_texture(std::filesystem::path const &path) -> Texture2D const &
|
||||
{
|
||||
if (m_textures.contains(path)) {
|
||||
return m_textures[path];
|
||||
}
|
||||
auto fname = path.c_str();
|
||||
assert(fname);
|
||||
TraceLog(LOG_INFO, std::format("loading texture at {}", fname).c_str());
|
||||
auto const tex = LoadTexture(fname);
|
||||
assert(IsTextureValid(tex));
|
||||
m_textures[path] = tex;
|
||||
return m_textures[path];
|
||||
}
|
||||
|
||||
enum_array<Theme, ColorScheme> m_themes { make_default_themes() };
|
||||
Theme m_active_theme { Theme::Light };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user