working on major updates

main
Brett 2023-12-30 03:26:06 -05:00
parent 789797a903
commit 1ec7e17517
4 changed files with 77 additions and 1 deletions

View File

@ -22,6 +22,8 @@
namespace blt::gfx namespace blt::gfx
{ {
} }
#endif //BLT_WITH_GRAPHICS_BATCH_2D_RENDERER_H #endif //BLT_WITH_GRAPHICS_BATCH_2D_RENDERER_H

View File

@ -0,0 +1,49 @@
/*
* <Short Description>
* Copyright (C) 2023 Brett Terpstra
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef BLT_WITH_GRAPHICS_TEXTURE_MANAGER_H
#define BLT_WITH_GRAPHICS_TEXTURE_MANAGER_H
#include <blt/std/hashmap.h>
#include <blt/gfx/texture.h>
#include <blt/std/thread.h>
#include <string>
namespace blt::gfx
{
struct loadable_texture
{
std::string path;
std::string name;
};
class texture_resource_manager
{
private:
blt::thread_pool<false> pool;
std::vector<loadable_texture> textures_to_load;
HASHMAP<std::string, texture_gl2D*> textures_2d;
public:
texture_resource_manager() = default;
~texture_resource_manager();
};
}
#endif //BLT_WITH_GRAPHICS_TEXTURE_MANAGER_H

@ -1 +1 @@
Subproject commit cc64e71c8d4ef550bad1eed5aaee3bd45fef9cad Subproject commit d913e959658d9194be031b356bf815d766e06d80

View File

@ -0,0 +1,25 @@
/*
* <Short Description>
* Copyright (C) 2023 Brett Terpstra
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <blt/gfx/renderer/texture_manager.h>
#include <blt/std/logging.h>
blt::gfx::texture_resource_manager::~texture_resource_manager()
{
for (const auto& p : textures_2d)
delete p.second;
}