emscripten, mostly working

main
Brett 2024-04-26 01:41:53 -04:00
parent 7c7e97872d
commit 0233ce7549
3 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.25)
set(BLT_GRAPHICS_VERSION 0.10.2) set(BLT_GRAPHICS_VERSION 0.11.0)
set(BLT_GRAPHICS_TEST_VERSION 0.0.1) set(BLT_GRAPHICS_TEST_VERSION 0.0.1)
project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION}) project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION})

@ -1 +1 @@
Subproject commit 1772e9a6d7fe3bd866c4daac5546347634178cb4 Subproject commit c8ce910fe17ecbc64ad728aac731c1fda8e84c33

View File

@ -35,6 +35,7 @@ namespace blt::gfx
void resource_manager::load_resources(std::size_t threads) void resource_manager::load_resources(std::size_t threads)
{ {
#ifndef __EMSCRIPTEN__
blt::thread_pool<false> pool{threads, [&]() { blt::thread_pool<false> pool{threads, [&]() {
loadable_texture texture; loadable_texture texture;
{ {
@ -71,8 +72,19 @@ namespace blt::gfx
} }
} }
} while (true); } while (true);
#else
for (const auto& texture : textures_to_load)
{
BLT_DEBUG("Loading texture file %s", texture.path.c_str());
loaded_textures.push_back(new texture_file(texture.path, texture.name));
}
textures_to_load.clear();
#endif
#ifndef __EMSCRIPTEN__
pool.stop(); pool.stop();
while (!pool.complete()); while (!pool.complete());
#endif
while (!loaded_textures.empty()) while (!loaded_textures.empty())
{ {
auto* back = loaded_textures.back(); auto* back = loaded_textures.back();