Files
XCSDD/docs/api/resources/asyncloader/submit.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

36 lines
890 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AsyncLoader::Submit
```cpp
void Submit(const Containers::String& path, ResourceType type,
std::function<void(LoadResult)> callback)
void Submit(const Containers::String& path, ResourceType type, ImportSettings* settings,
std::function<void(LoadResult)> callback)
```
提交异步加载请求。将请求加入待处理队列,由工作线程在后台执行加载。
**参数:**
- `path` - 资源路径
- `type` - 资源类型
- `settings` - 导入设置(可为 nullptr
- `callback` - 加载完成回调
**返回:**
**复杂度:** O(1)
**示例:**
```cpp
AsyncLoader::Get().Submit("textures/player.png", ResourceType::Texture,
[](LoadResult result) {
if (result.success) {
ResourceHandle<Texture> tex(result.resource);
}
});
```
## 相关文档
- [AsyncLoader 总览](asyncloader.md) - 返回类总览