diff --git a/docs/api/resources/audio-loader/constructor.md b/docs/api/resources/audio-loader/constructor.md new file mode 100644 index 00000000..7a309bec --- /dev/null +++ b/docs/api/resources/audio-loader/constructor.md @@ -0,0 +1,27 @@ +# AudioLoader::AudioLoader + +```cpp +AudioLoader(); +``` + +默认构造函数,创建一个 `AudioLoader` 实例。该加载器负责管理音频资源的加载流程。 + +**参数:** 无 + +**返回:** 无 + +**线程安全:** ✅ + +**示例:** + +```cpp +#include "Resources/AudioLoader.h" + +using namespace XCEngine::Resources; + +AudioLoader loader; +``` + +## 相关文档 + +- [AudioLoader 总览](index.md) - 返回类总览 diff --git a/docs/api/resources/audio-loader/destructor.md b/docs/api/resources/audio-loader/destructor.md new file mode 100644 index 00000000..174ef614 --- /dev/null +++ b/docs/api/resources/audio-loader/destructor.md @@ -0,0 +1,29 @@ +# AudioLoader::~AudioLoader + +```cpp +virtual ~AudioLoader() override; +``` + +析构函数,用于销毁 `AudioLoader` 对象。该析构函数不执行任何特殊清理操作。 + +**参数:** 无 + +**返回:** 无 + +**示例:** + +```cpp +#include "Resources/AudioLoader.h" + +using namespace XCEngine::Resources; + +{ + AudioLoader loader; + // 使用 loader... +} +// loader 在此自动销毁 +``` + +## 相关文档 + +- [AudioLoader 总览](index.md) - 返回类总览 diff --git a/docs/api/resources/audio-loader/index.md b/docs/api/resources/audio-loader/index.md index 5c92a232..073f0a87 100644 --- a/docs/api/resources/audio-loader/index.md +++ b/docs/api/resources/audio-loader/index.md @@ -20,13 +20,13 @@ | 方法 | 返回值 | 描述 | |------|--------|------| -| `AudioLoader()` | - | 构造函数 | -| `~AudioLoader()` | - | 析构函数 | -| `GetResourceType()` | `ResourceType` | 返回资源类型 `AudioClip` | -| `GetSupportedExtensions()` | `Array` | 获取支持的扩展名列表 | -| `CanLoad(path)` | `bool` | 检查是否能够加载指定路径的资源 | -| `Load(path, settings)` | `LoadResult` | 加载音频资源 | -| `GetDefaultSettings()` | `ImportSettings*` | 获取默认导入设置 | +| [AudioLoader](constructor.md) | - | 构造函数 | +| [~AudioLoader](destructor.md) | - | 析构函数 | +| [GetResourceType](get-resource-type.md) | `ResourceType` | 返回资源类型 `AudioClip` | +| [GetSupportedExtensions](get-supported-extensions.md) | `Array` | 获取支持的扩展名列表 | +| [CanLoad](can-load.md) | `bool` | 检查是否能够加载指定路径的资源 | +| [Load](load.md) | `LoadResult` | 加载音频资源 | +| [GetDefaultSettings](get-default-settings.md) | `ImportSettings*` | 获取默认导入设置 | ## 使用示例 @@ -48,9 +48,9 @@ if (result.IsSuccess()) { ## 相关文档 -- [GetSupportedExtensions](getsupportedextensions.md) - 获取支持的音频格式 -- [CanLoad](canload.md) - 检查资源可加载性 +- [GetSupportedExtensions](get-supported-extensions.md) - 获取支持的音频格式 +- [CanLoad](can-load.md) - 检查资源可加载性 - [Load](load.md) - 加载音频资源 -- [GetDefaultSettings](getdefaultsettings.md) - 获取默认导入设置 -- [IResourceLoader](../resource-loader/resource-loader.md) - 资源加载器基类 -- [AudioClip](../audioclip/audio-clip.md) - 音频资源类型 +- [GetDefaultSettings](get-default-settings.md) - 获取默认导入设置 +- [IResourceLoader](../iloader/iloader.md) - 资源加载器基类 +- [AudioClip](../audioclip/audioclip.md) - 音频资源类型 diff --git a/docs/api/resources/audioclip/audioclip.md b/docs/api/resources/audioclip/audioclip.md index e24ca8ef..6a13574f 100644 --- a/docs/api/resources/audioclip/audioclip.md +++ b/docs/api/resources/audioclip/audioclip.md @@ -15,7 +15,7 @@ ## 头文件 ```cpp -#include "Resources/AudioClip.h" +#include ``` ## 枚举类型 @@ -45,6 +45,13 @@ ## 公共方法 +### 构造与析构 + +| 方法 | 描述 | +|------|------| +| [AudioClip](constructor.md) | 默认构造函数 | +| [~AudioClip](destructor.md) | 析构函数 | + ### 基础属性 | 方法 | 描述 | @@ -53,16 +60,54 @@ | `const Containers::String& GetName() const` | 获取音频名称 | | `const Containers::String& GetPath() const` | 获取音频路径 | | `ResourceGUID GetGUID() const` | 获取全局唯一标识符 | -| `bool IsValid() const` | 检查音频是否有效 | -| `size_t GetMemorySize() const` | 获取内存大小 | -| `void Release()` | 释放音频引用 | +| [IsValid](is-valid.md) | 检查音频是否有效 | +| [GetMemorySize](get-memory-size.md) | 获取内存大小 | +| [Release](release.md) | 释放音频引用 | ### 音频数据 | 方法 | 描述 | |------|------| -| `void SetAudioData(const Containers::Array& data)` | 设置音频数据(需先设置采样率、通道数、位深度,自动计算时长) | -| `const Containers::Array& GetAudioData() const` | 获取音频数据指针 | +| [SetAudioData](setaudiodata.md) | 设置音频数据(需先设置采样率、通道数、位深度,自动计算时长) | +| [GetAudioData](get-audio-data.md) | 获取音频数据指针 | + +### 音频参数 + +| 方法 | 描述 | +|------|------| +| [SetSampleRate](set-sample-rate.md) | 设置采样率(Hz) | +| [GetSampleRate](get-sample-rate.md) | 获取采样率 | +| [SetChannels](set-channels.md) | 设置通道数(1=单声道, 2=立体声) | +| [GetChannels](get-channels.md) | 获取通道数 | +| [SetBitsPerSample](set-bits-per-sample.md) | 设置位深度(8/16/24/32) | +| [GetBitsPerSample](get-bits-per-sample.md) | 获取位深度 | +| [SetDuration](set-duration.md) | 设置时长(秒) | +| [GetDuration](get-duration.md) | 获取时长(秒) | + +### 格式与类型 + +| 方法 | 描述 | +|------|------| +| [SetAudioFormat](set-audio-format.md) | 设置音频格式 | +| [GetAudioFormat](get-audio-format.md) | 获取音频格式 | +| [SetAudioType](set-audio-type.md) | 设置音频类型 | +| [GetAudioType](get-audio-type.md) | 获取音频类型 | + +### 3D 和循环 + +| 方法 | 描述 | +|------|------| +| [SetIs3D](set-is-3d.md) | 设置是否为 3D 音频 | +| [Is3D](is-3d.md) | 检查是否为 3D 音频 | +| [SetLoop](set-loop.md) | 设置是否循环播放 | +| [IsLoop](is-loop.md) | 检查是否循环播放 | + +### RHI 资源 + +| 方法 | 描述 | +|------|------| +| [GetRHIResource](get-rhi-resource.md) | 获取 RHI 音频缓冲区 | +| [SetRHIResource](set-rhi-resource.md) | 设置 RHI 音频缓冲区 | ## 实现说明 @@ -71,47 +116,14 @@ - `AudioLoader::ParseWAVData()` 为 stub,始终返回 true。 - `AudioLoader::DetectAudioFormat()` 不检测 AIFF/AIF 格式的文件头,仅依赖扩展名判断。 -### 音频参数 - -| 方法 | 描述 | -|------|------| -| `void SetSampleRate(Core::uint32 rate)` | 设置采样率(Hz) | -| `Core::uint32 GetSampleRate() const` | 获取采样率 | -| `void SetChannels(Core::uint32 channels)` | 设置通道数(1=单声道, 2=立体声) | -| `Core::uint32 GetChannels() const` | 获取通道数 | -| `void SetBitsPerSample(Core::uint32 bits)` | 设置位深度(8/16/24/32) | -| `Core::uint32 GetBitsPerSample() const` | 获取位深度 | -| `void SetDuration(float seconds)` | 设置时长(秒) | -| `float GetDuration() const` | 获取时长(秒) | - -### 格式与类型 - -| 方法 | 描述 | -|------|------| -| `void SetAudioFormat(AudioFormat format)` | 设置音频格式 | -| `AudioFormat GetAudioFormat() const` | 获取音频格式 | -| `void SetAudioType(AudioType type)` | 设置音频类型 | -| `AudioType GetAudioType() const` | 获取音频类型 | - -### 3D 和循环 - -| 方法 | 描述 | -|------|------| -| `void SetIs3D(bool is3D)` | 设置是否为 3D 音频 | -| `bool Is3D() const` | 检查是否为 3D 音频 | -| `void SetLoop(bool loop)` | 设置是否循环播放 | -| `bool IsLoop() const` | 检查是否循环播放 | - -### RHI 资源 - -| 方法 | 描述 | -|------|------| -| `class IRHIAudioBuffer* GetRHIResource() const` | 获取 RHI 音频缓冲区 | -| `void SetRHIResource(class IRHIAudioBuffer* resource)` | 设置 RHI 音频缓冲区 | - ## 使用示例 ```cpp +#include +#include + +using namespace XCEngine::Resources; + // 加载音频 ResourceHandle sfx = ResourceManager::Get().Load("sounds/explosion.wav"); ResourceHandle music = ResourceManager::Get().Load("music/background.ogg"); diff --git a/docs/api/resources/material-loader/index.md b/docs/api/resources/material-loader/index.md index 95f17c5e..74cb8feb 100644 --- a/docs/api/resources/material-loader/index.md +++ b/docs/api/resources/material-loader/index.md @@ -20,8 +20,8 @@ | 方法 | 签名 | 描述 | |------|------|------| -| [MaterialLoader](methods/material-loader-constructor.md) | `MaterialLoader()` | 默认构造函数 | -| [~MaterialLoader](methods/material-loader-destructor.md) | `virtual ~MaterialLoader()` | 析构函数 | +| [MaterialLoader](methods/constructor.md) | `MaterialLoader()` | 默认构造函数 | +| [~MaterialLoader](methods/destructor.md) | `virtual ~MaterialLoader()` | 析构函数 | | [GetResourceType](methods/get-resource-type.md) | `ResourceType GetResourceType() const` | 返回资源类型为 Material | | [GetSupportedExtensions](methods/get-supported-extensions.md) | `Array GetSupportedExtensions() const` | 返回支持的扩展名列表 | | [CanLoad](methods/can-load.md) | `bool CanLoad(const String& path) const` | 检查给定路径是否可被加载 | @@ -56,4 +56,4 @@ if (result.IsSuccess()) { - [Material](../material/material.md) - [IResourceLoader](../iloader/iloader.md) -- [ResourceManager](../resource-manager/resource-manager.md) +- [ResourceManager](../resourcemanager/resourcemanager.md) diff --git a/docs/api/resources/shader-loader/index.md b/docs/api/resources/shader-loader/index.md index f3e8381e..4c100f63 100644 --- a/docs/api/resources/shader-loader/index.md +++ b/docs/api/resources/shader-loader/index.md @@ -56,4 +56,4 @@ if (result.IsSuccess()) { - [Shader](../shader/shader.md) - [IResourceLoader](../iloader/iloader.md) -- [ResourceManager](../resource-manager/resource-manager.md) +- [ResourceManager](../resourcemanager/resourcemanager.md) diff --git a/docs/api/resources/texture-import-settings/texture-import-settings.md b/docs/api/resources/texture-import-settings/texture-import-settings.md index 46045716..e16be651 100644 --- a/docs/api/resources/texture-import-settings/texture-import-settings.md +++ b/docs/api/resources/texture-import-settings/texture-import-settings.md @@ -24,37 +24,37 @@ |------|------| | `TextureImportSettings()` | 构造函数 | | `virtual ~TextureImportSettings() override` | 析构函数 | -| `Core::UniqueRef Clone() const override` | 克隆设置对象 | -| `bool LoadFromJSON(const Containers::String& json) override` | 从 JSON 加载设置(stub) | -| `Containers::String SaveToJSON() const override` | 保存为 JSON(stub) | -| `void SetTextureType(TextureType type)` | 设置纹理类型 | -| `TextureType GetTextureType() const` | 获取纹理类型 | -| `void SetTargetFormat(TextureFormat format)` | 设置目标格式 | -| `TextureFormat GetTargetFormat() const` | 获取目标格式 | -| `void SetGenerateMipmaps(bool generate)` | 设置是否生成 Mipmap | -| `bool GetGenerateMipmaps() const` | 获取是否生成 Mipmap | -| `void SetMipmapFilter(MipmapFilter filter)` | 设置 Mipmap 滤波器 | -| `MipmapFilter GetMipmapFilter() const` | 获取 Mipmap 滤波器 | -| `void SetMaxAnisotropy(Core::uint32 anisotropy)` | 设置最大各向异性级别 | -| `Core::uint32 GetMaxAnisotropy() const` | 获取最大各向异性级别 | -| `void SetSRGB(bool srgb)` | 设置是否 sRGB | -| `bool GetSRGB() const` | 获取 sRGB 设置 | -| `void SetFlipVertical(bool flip)` | 设置是否垂直翻转 | -| `bool GetFlipVertical() const` | 获取垂直翻转设置 | -| `void SetFlipHorizontal(bool flip)` | 设置是否水平翻转 | -| `bool GetFlipHorizontal() const` | 获取水平翻转设置 | -| `void SetBorderColor(const Math::Vector3& color)` | 设置边框颜色 | -| `const Math::Vector3& GetBorderColor() const` | 获取边框颜色 | -| `void SetCompressionQuality(CompressionQuality quality)` | 设置压缩质量 | -| `CompressionQuality GetCompressionQuality() const` | 获取压缩质量 | -| `void SetUseHardwareCompression(bool use)` | 设置是否使用硬件压缩 | -| `bool GetUseHardwareCompression() const` | 获取硬件压缩设置 | -| `void SetMaxSize(Core::uint32 size)` | 设置最大纹理尺寸 | -| `Core::uint32 GetMaxSize() const` | 获取最大纹理尺寸 | -| `void SetGenerateNormalMap(bool generate)` | 设置是否生成法线贴图 | -| `bool GetGenerateNormalMap() const` | 获取法线贴图生成设置 | -| `void SetNormalMapStrength(float strength)` | 设置法线贴图强度 | -| `float GetNormalMapStrength() const` | 获取法线贴图强度 | +| [Clone](clone.md) | 克隆设置对象 | +| [LoadFromJSON](loadfromjson.md) | 从 JSON 加载设置(stub) | +| [SaveToJSON](savetojson.md) | 保存为 JSON(stub) | +| [SetTextureType](settexturetype.md) | 设置纹理类型 | +| [GetTextureType](gettexturetype.md) | 获取纹理类型 | +| [SetTargetFormat](settargetformat.md) | 设置目标格式 | +| [GetTargetFormat](gettargetformat.md) | 获取目标格式 | +| [SetGenerateMipmaps](setgeneratemipmaps.md) | 设置是否生成 Mipmap | +| [GetGenerateMipmaps](getgeneratemipmaps.md) | 获取是否生成 Mipmap | +| [SetMipmapFilter](setmipmapfilter.md) | 设置 Mipmap 滤波器 | +| [GetMipmapFilter](getmipmapfilter.md) | 获取 Mipmap 滤波器 | +| [SetMaxAnisotropy](setmaxanisotropy.md) | 设置最大各向异性级别 | +| [GetMaxAnisotropy](getmaxanisotropy.md) | 获取最大各向异性级别 | +| [SetSRGB](setsrgb.md) | 设置是否 sRGB | +| [GetSRGB](getsrgb.md) | 获取 sRGB 设置 | +| [SetFlipVertical](setflipvertical.md) | 设置是否垂直翻转 | +| [GetFlipVertical](getflipvertical.md) | 获取垂直翻转设置 | +| [SetFlipHorizontal](setfliphhorizontal.md) | 设置是否水平翻转 | +| [GetFlipHorizontal](getfliphhorizontal.md) | 获取水平翻转设置 | +| [SetBorderColor](setbordercolor.md) | 设置边框颜色 | +| [GetBorderColor](getbordercolor.md) | 获取边框颜色 | +| [SetCompressionQuality](setcompressionquality.md) | 设置压缩质量 | +| [GetCompressionQuality](getcompressionquality.md) | 获取压缩质量 | +| [SetUseHardwareCompression](setusehardwarecompression.md) | 设置是否使用硬件压缩 | +| [GetUseHardwareCompression](getusehardwarecompression.md) | 获取硬件压缩设置 | +| [SetMaxSize](setmaxsize.md) | 设置最大纹理尺寸 | +| [GetMaxSize](getmaxsize.md) | 获取最大纹理尺寸 | +| [SetGenerateNormalMap](setgeneratenormalmap.md) | 设置是否生成法线贴图 | +| [GetGenerateNormalMap](getgeneratenormalmap.md) | 获取法线贴图生成设置 | +| [SetNormalMapStrength](setnormalmapstrength.md) | 设置法线贴图强度 | +| [GetNormalMapStrength](getnormalmapstrength.md) | 获取法线贴图强度 | --- @@ -112,7 +112,6 @@ ResourceHandle tex = ResourceManager::Get().Load("textures/dif ## 相关文档 -- [方法详情](methods.md) - 所有方法的详细文档 - [ImportSettings](../importsettings/importsettings.md) - 导入设置基类 - [IResourceLoader](../iloader/iloader.md) - 资源加载器接口 - [ResourceManager](../resourcemanager/resourcemanager.md) - 资源管理器 diff --git a/docs/api/resources/texture-loader/constructor.md b/docs/api/resources/texture-loader/constructor.md new file mode 100644 index 00000000..6af3425a --- /dev/null +++ b/docs/api/resources/texture-loader/constructor.md @@ -0,0 +1,27 @@ +# TextureLoader::TextureLoader + +```cpp +TextureLoader(); +``` + +默认构造函数,创建一个 `TextureLoader` 实例。该加载器负责管理纹理资源的加载流程。 + +**参数:** 无 + +**返回:** 无 + +**线程安全:** ✅ + +**示例:** + +```cpp +#include "Resources/TextureLoader.h" + +using namespace XCEngine::Resources; + +TextureLoader loader; +``` + +## 相关文档 + +- [TextureLoader 总览](index.md) - 返回类总览 diff --git a/docs/api/resources/texture-loader/destructor.md b/docs/api/resources/texture-loader/destructor.md new file mode 100644 index 00000000..074ef98d --- /dev/null +++ b/docs/api/resources/texture-loader/destructor.md @@ -0,0 +1,29 @@ +# TextureLoader::~TextureLoader + +```cpp +virtual ~TextureLoader() override; +``` + +析构函数,用于销毁 `TextureLoader` 对象。该析构函数不执行任何特殊清理操作。 + +**参数:** 无 + +**返回:** 无 + +**示例:** + +```cpp +#include "Resources/TextureLoader.h" + +using namespace XCEngine::Resources; + +{ + TextureLoader loader; + // 使用 loader... +} +// loader 在此自动销毁 +``` + +## 相关文档 + +- [TextureLoader 总览](index.md) - 返回类总览 diff --git a/docs/api/resources/texture-loader/index.md b/docs/api/resources/texture-loader/index.md index c89bd578..21712ac0 100644 --- a/docs/api/resources/texture-loader/index.md +++ b/docs/api/resources/texture-loader/index.md @@ -34,11 +34,13 @@ | 方法 | 描述 | |------|------| -| `ResourceType GetResourceType() const` | 返回 `ResourceType::Texture` | -| `Containers::Array GetSupportedExtensions() const` | 获取支持的扩展名列表 | -| `bool CanLoad(const Containers::String& path) const` | 检查是否支持加载指定路径的纹理 | -| `LoadResult Load(const Containers::String& path, const ImportSettings* settings = nullptr)` | 加载纹理资源 | -| `ImportSettings* GetDefaultSettings() const` | 获取默认导入设置 | +| [TextureLoader](constructor.md) | 构造函数 | +| [~TextureLoader](destructor.md) | 析构函数 | +| [GetResourceType](get-resource-type.md) | 返回 `ResourceType::Texture` | +| [GetSupportedExtensions](get-supported-extensions.md) | 获取支持的扩展名列表 | +| [CanLoad](can-load.md) | 检查是否支持加载指定路径的纹理 | +| [Load](load.md) | 加载纹理资源 | +| [GetDefaultSettings](get-default-settings.md) | 获取默认导入设置 | ### GetResourceType diff --git a/docs/api/resources/texture/texture.md b/docs/api/resources/texture/texture.md index 636052a1..fb83c5dd 100644 --- a/docs/api/resources/texture/texture.md +++ b/docs/api/resources/texture/texture.md @@ -85,8 +85,8 @@ | 方法 | 描述 | |------|------| -| [`Texture`](texture_constructor.md) | 默认构造函数 | -| [`~Texture`](texture_destructor.md) | 析构函数 | +| [`Texture`](constructor.md) | 默认构造函数 | +| [`~Texture`](destructor.md) | 析构函数 | ### IResource 实现