@@ -985,6 +985,18 @@ auto luma::application::load_texture(std::string path) -> std::expected<std::sha
|
||||
return core->assets->texture(path); }, false);
|
||||
}
|
||||
|
||||
auto luma::application::load_texture_uncached(std::string path) -> std::expected<std::shared_ptr<luma::texture>, modulus::error> {
|
||||
if (path.empty()) {
|
||||
return luma::detail::fail<std::shared_ptr<luma::texture>>(luma::detail::error_invalid_argument, "texture path must not be empty");
|
||||
}
|
||||
auto core = core_snapshot();
|
||||
return dispatch_to_ui<std::shared_ptr<luma::texture>>(core, [core, path = std::move(path)] {
|
||||
if (!core->renderer_active.load(std::memory_order_acquire) || !core->resources) {
|
||||
return unavailable<std::shared_ptr<luma::texture>>("texture loading requires an active renderer");
|
||||
}
|
||||
return core->resources->load_texture(path); }, false);
|
||||
}
|
||||
|
||||
auto luma::application::request_layout() -> std::expected<void, modulus::error> {
|
||||
auto core = core_snapshot();
|
||||
return dispatch_to_ui<void>(core, [core] {
|
||||
|
||||
Reference in New Issue
Block a user