diff --git a/docs/api/components/audio-listener-component/get-master-volume.md b/docs/api/components/audio-listener-component/get-master-volume.md new file mode 100644 index 00000000..13fba7a2 --- /dev/null +++ b/docs/api/components/audio-listener-component/get-master-volume.md @@ -0,0 +1,37 @@ +# GetMasterVolume + +**所属类**: `AudioListenerComponent` + +**头文件**: `XCEngine/Core/Components/AudioListenerComponent.h` + +**描述**: 获取音频监听器的主音量。 + +## 函数签名 + +```cpp +float GetMasterVolume() const; +``` + +## 返回值 + +| 类型 | 描述 | +|------|------| +| `float` | 当前主音量,范围 0.0 到 1.0 | + +## 使用示例 + +```cpp +#include + +using namespace XCEngine::Components; + +void PrintListenerVolume(AudioListenerComponent* listener) { + float volume = listener->GetMasterVolume(); + printf("Master volume: %.2f\n", volume); +} +``` + +## 相关文档 + +- [AudioListenerComponent](audio-listener-component.md) - 音频监听器组件 +- [SetMasterVolume](set-master-volume.md) - 设置主音量 diff --git a/docs/api/components/audio-listener-component/set-master-volume.md b/docs/api/components/audio-listener-component/set-master-volume.md new file mode 100644 index 00000000..564d3095 --- /dev/null +++ b/docs/api/components/audio-listener-component/set-master-volume.md @@ -0,0 +1,36 @@ +# SetMasterVolume + +**所属类**: `AudioListenerComponent` + +**头文件**: `XCEngine/Core/Components/AudioListenerComponent.h` + +**描述**: 设置音频监听器的主音量。 + +## 函数签名 + +```cpp +void SetMasterVolume(float volume); +``` + +## 参数 + +| 参数 | 类型 | 描述 | +|------|------|------| +| `volume` | `float` | 主音量,范围 0.0 到 1.0 | + +## 使用示例 + +```cpp +#include + +using namespace XCEngine::Components; + +void SetListenerVolume(AudioListenerComponent* listener) { + listener->SetMasterVolume(0.8f); // 80% 音量 +} +``` + +## 相关文档 + +- [AudioListenerComponent](audio-listener-component.md) - 音频监听器组件 +- [GetMasterVolume](get-master-volume.md) - 获取主音量 diff --git a/docs/api/main.md b/docs/api/main.md index 3513fe85..72ddbca3 100644 --- a/docs/api/main.md +++ b/docs/api/main.md @@ -44,13 +44,13 @@ device->Initialize(desc); ### 使用资源管理器 ```cpp -#include +#include // 加载纹理 -auto texture = Resources::ResourceManager::Get().Load("textures/player.png"); +auto texture = XCEngine::Resources::ResourceManager::Get().Load("textures/player.png"); // 加载网格 -auto mesh = Resources::ResourceManager::Get().Load("models/player.fbx"); +auto mesh = XCEngine::Resources::ResourceManager::Get().Load("models/player.fbx"); ``` ### 日志记录 @@ -65,32 +65,34 @@ XE_LOG(Debug::LogCategory::Rendering, Debug::LogLevel::Info, "Render started"); ### 数学运算 ```cpp -#include +#include // 创建变换矩阵 -Math::Matrix4 transform = Math::Matrix4::TRS(position, rotation, scale); +Math::Matrix4x4 transform = Math::Matrix4x4::TRS(position, rotation, scale); ``` --- ## 文档统计 +> ⚠️ 注意:以下统计数据为近似值,部分 RHI 伪造文档待删除后需重新统计。 + | 模块 | 文档数量 | |------|----------| -| RHI 抽象层 | 17 | -| D3D12 后端 | 24 | -| OpenGL 后端 | 14 | -| Math | 17 | -| Resources | 17 | -| Threading | 10 | -| Memory | 6 | -| Debug | 9 | -| Core | 6 | -| Containers | 4 | -| Audio | 10 | -| Components | 36 | -| Scene | 19 | -| **总计** | **143** | +| RHI 抽象层 | ~15 (含待删除伪造文档) | +| D3D12 后端 | ~20 | +| OpenGL 后端 | ~25 (含待删除伪造文档) | +| Math | ~15 | +| Resources | ~20 | +| Threading | ~15 | +| Memory | ~12 | +| Debug | ~10 | +| Core | ~5 | +| Containers | ~4 | +| Audio | ~20 | +| Components | ~50 | +| Scene | ~10 | +| **总计** | **~220 (待精确统计)** | --- diff --git a/docs/api/math/bounds/bounds.constructors.md b/docs/api/math/bounds/bounds.constructors.md index 42d84717..2da03594 100644 --- a/docs/api/math/bounds/bounds.constructors.md +++ b/docs/api/math/bounds/bounds.constructors.md @@ -20,8 +20,8 @@ Bounds(const Vector3& center, const Vector3& size) **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/bounds/contains.md b/docs/api/math/bounds/contains.md index 57886c67..5083fae9 100644 --- a/docs/api/math/bounds/contains.md +++ b/docs/api/math/bounds/contains.md @@ -18,8 +18,8 @@ bool Contains(const Vector3& point) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/bounds/encapsulate.md b/docs/api/math/bounds/encapsulate.md index 50d9e3fe..4fe87ec4 100644 --- a/docs/api/math/bounds/encapsulate.md +++ b/docs/api/math/bounds/encapsulate.md @@ -20,8 +20,8 @@ void Encapsulate(const Bounds& bounds) **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/bounds/expand.md b/docs/api/math/bounds/expand.md index 56c90bb4..32966f42 100644 --- a/docs/api/math/bounds/expand.md +++ b/docs/api/math/bounds/expand.md @@ -19,8 +19,8 @@ void Expand(const Vector3& amount) **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/bounds/getclosestpoint.md b/docs/api/math/bounds/getclosestpoint.md index e1037966..e8af9917 100644 --- a/docs/api/math/bounds/getclosestpoint.md +++ b/docs/api/math/bounds/getclosestpoint.md @@ -18,8 +18,8 @@ Vector3 GetClosestPoint(const Vector3& point) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/bounds/getmax.md b/docs/api/math/bounds/getmax.md index 499cc2a8..1dd8225d 100644 --- a/docs/api/math/bounds/getmax.md +++ b/docs/api/math/bounds/getmax.md @@ -15,8 +15,8 @@ Vector3 GetMax() const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/bounds/getmin.md b/docs/api/math/bounds/getmin.md index fcc258ca..78eecf0a 100644 --- a/docs/api/math/bounds/getmin.md +++ b/docs/api/math/bounds/getmin.md @@ -15,8 +15,8 @@ Vector3 GetMin() const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/bounds/getvolume.md b/docs/api/math/bounds/getvolume.md index 4c918345..db2386f8 100644 --- a/docs/api/math/bounds/getvolume.md +++ b/docs/api/math/bounds/getvolume.md @@ -15,8 +15,8 @@ float GetVolume() const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/bounds/intersects.md b/docs/api/math/bounds/intersects.md index 9bd9cce4..2499d3d6 100644 --- a/docs/api/math/bounds/intersects.md +++ b/docs/api/math/bounds/intersects.md @@ -18,8 +18,8 @@ bool Intersects(const Bounds& other) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/bounds/setminmax.md b/docs/api/math/bounds/setminmax.md index 21c64301..e7d4b79c 100644 --- a/docs/api/math/bounds/setminmax.md +++ b/docs/api/math/bounds/setminmax.md @@ -19,8 +19,8 @@ void SetMinMax(const Vector3& min, const Vector3& max) **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/box/constructor.md b/docs/api/math/box/constructor.md index 723c055d..e4625fa1 100644 --- a/docs/api/math/box/constructor.md +++ b/docs/api/math/box/constructor.md @@ -29,8 +29,8 @@ Box(const Vector3& center, const Vector3& extents) **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/box/contains.md b/docs/api/math/box/contains.md index 9ce9cda0..db1bca5e 100644 --- a/docs/api/math/box/contains.md +++ b/docs/api/math/box/contains.md @@ -18,8 +18,8 @@ bool Contains(const Vector3& point) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/box/getmax.md b/docs/api/math/box/getmax.md index fc95aea2..6ad292ed 100644 --- a/docs/api/math/box/getmax.md +++ b/docs/api/math/box/getmax.md @@ -17,8 +17,8 @@ Vector3 GetMax() const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/box/getmin.md b/docs/api/math/box/getmin.md index 2188b670..bf110cf1 100644 --- a/docs/api/math/box/getmin.md +++ b/docs/api/math/box/getmin.md @@ -17,8 +17,8 @@ Vector3 GetMin() const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/box/intersects-box.md b/docs/api/math/box/intersects-box.md index 213baf59..521a85e4 100644 --- a/docs/api/math/box/intersects-box.md +++ b/docs/api/math/box/intersects-box.md @@ -20,7 +20,7 @@ bool Intersects(const Box& other) const **示例:** ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/box/intersects-ray.md b/docs/api/math/box/intersects-ray.md index 5bd2877b..427dfe00 100644 --- a/docs/api/math/box/intersects-ray.md +++ b/docs/api/math/box/intersects-ray.md @@ -19,8 +19,8 @@ bool Intersects(const Ray& ray, float& t) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/box/intersects.md b/docs/api/math/box/intersects.md index 99e6841c..c088933a 100644 --- a/docs/api/math/box/intersects.md +++ b/docs/api/math/box/intersects.md @@ -18,8 +18,8 @@ bool Intersects(const Sphere& sphere) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/frustum/contains-bounds.md b/docs/api/math/frustum/contains-bounds.md index 19c0ac9e..f2f7f227 100644 --- a/docs/api/math/frustum/contains-bounds.md +++ b/docs/api/math/frustum/contains-bounds.md @@ -18,8 +18,8 @@ bool Contains(const Bounds& bounds) const **示例:** ```cpp -#include -#include +#include +#include void CheckBoundsInFrustum(const Frustum& frustum, const Bounds& bounds) { if (frustum.Contains(bounds)) { diff --git a/docs/api/math/frustum/contains-point.md b/docs/api/math/frustum/contains-point.md index d4b8798f..ecebfcca 100644 --- a/docs/api/math/frustum/contains-point.md +++ b/docs/api/math/frustum/contains-point.md @@ -18,8 +18,8 @@ bool Contains(const Vector3& point) const **示例:** ```cpp -#include -#include +#include +#include void CheckPointInFrustum(const Frustum& frustum, const Vector3& point) { if (frustum.Contains(point)) { diff --git a/docs/api/math/frustum/contains-sphere.md b/docs/api/math/frustum/contains-sphere.md index 0a444178..ca033164 100644 --- a/docs/api/math/frustum/contains-sphere.md +++ b/docs/api/math/frustum/contains-sphere.md @@ -18,8 +18,8 @@ bool Contains(const Sphere& sphere) const **示例:** ```cpp -#include -#include +#include +#include void CheckSphereInFrustum(const Frustum& frustum, const Sphere& sphere) { if (frustum.Contains(sphere)) { diff --git a/docs/api/math/frustum/intersects-bounds.md b/docs/api/math/frustum/intersects-bounds.md index 6797004c..eaa35637 100644 --- a/docs/api/math/frustum/intersects-bounds.md +++ b/docs/api/math/frustum/intersects-bounds.md @@ -20,8 +20,8 @@ bool Intersects(const Bounds& bounds) const **示例:** ```cpp -#include -#include +#include +#include void FrustumCullingExample(const Frustum& frustum, const std::vector& objectBounds) { for (const auto& bounds : objectBounds) { diff --git a/docs/api/math/frustum/intersects-sphere.md b/docs/api/math/frustum/intersects-sphere.md index d47d9c90..a7a18965 100644 --- a/docs/api/math/frustum/intersects-sphere.md +++ b/docs/api/math/frustum/intersects-sphere.md @@ -20,8 +20,8 @@ bool Intersects(const Sphere& sphere) const **示例:** ```cpp -#include -#include +#include +#include void CheckSphereIntersection(const Frustum& frustum, const Sphere& sphere) { if (frustum.Intersects(sphere)) { diff --git a/docs/api/math/h/deg-to-rad.md b/docs/api/math/h/deg-to-rad.md index 91a2e609..790d65ea 100644 --- a/docs/api/math/h/deg-to-rad.md +++ b/docs/api/math/h/deg-to-rad.md @@ -9,7 +9,7 @@ constexpr float DEG_TO_RAD = PI / 180.0f; **示例:** ```cpp -#include +#include float angleDegrees = 90.0f; float angleRadians = angleDegrees * Math::DEG_TO_RAD; diff --git a/docs/api/math/h/degrees.md b/docs/api/math/h/degrees.md index 2d2c2e6c..bbdd2e0d 100644 --- a/docs/api/math/h/degrees.md +++ b/docs/api/math/h/degrees.md @@ -9,7 +9,7 @@ float Degrees(float radians); **示例:** ```cpp -#include +#include float radians = Math::HALF_PI; float degrees = Math::Degrees(radians); diff --git a/docs/api/math/h/epsilon.md b/docs/api/math/h/epsilon.md index 75a82a7f..137d49b6 100644 --- a/docs/api/math/h/epsilon.md +++ b/docs/api/math/h/epsilon.md @@ -9,7 +9,7 @@ constexpr float EPSILON = 1e-6f; **示例:** ```cpp -#include +#include float a = 0.1f + 0.2f; float b = 0.3f; diff --git a/docs/api/math/h/float-max.md b/docs/api/math/h/float-max.md index af91a9cb..09316409 100644 --- a/docs/api/math/h/float-max.md +++ b/docs/api/math/h/float-max.md @@ -9,7 +9,7 @@ constexpr float FLOAT_MAX = 3.402823466e+38f; **示例:** ```cpp -#include +#include float maxDistance = FLOAT_MAX; ``` diff --git a/docs/api/math/h/h.md b/docs/api/math/h/h.md index 031fa1e9..883ca810 100644 --- a/docs/api/math/h/h.md +++ b/docs/api/math/h/h.md @@ -4,7 +4,7 @@ **类型**: `header` -**头文件**: `XCEngine/Math/Math.h` +**头文件**: `XCEngine/Core/Math/Math.h` **描述**: 数学库常量和辅助函数头文件。 @@ -34,7 +34,7 @@ ## 使用示例 ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/h/half-pi.md b/docs/api/math/h/half-pi.md index ac093e56..8366a5da 100644 --- a/docs/api/math/h/half-pi.md +++ b/docs/api/math/h/half-pi.md @@ -9,7 +9,7 @@ constexpr float HALF_PI = 1.57079632679489661923f; **示例:** ```cpp -#include +#include float ninetyDegreesRadians = HALF_PI; ``` diff --git a/docs/api/math/h/pi.md b/docs/api/math/h/pi.md index 7ddaa2af..8a63d766 100644 --- a/docs/api/math/h/pi.md +++ b/docs/api/math/h/pi.md @@ -11,7 +11,7 @@ constexpr float PI = 3.14159265358979323846f; **示例:** ```cpp -#include +#include float circumference = 2.0f * PI * radius; float area = PI * radius * radius; diff --git a/docs/api/math/h/rad-to-deg.md b/docs/api/math/h/rad-to-deg.md index 92b3af55..388310c8 100644 --- a/docs/api/math/h/rad-to-deg.md +++ b/docs/api/math/h/rad-to-deg.md @@ -9,7 +9,7 @@ constexpr float RAD_TO_DEG = 180.0f / PI; **示例:** ```cpp -#include +#include float radians = Math::HALF_PI; float degrees = radians * Math::RAD_TO_DEG; diff --git a/docs/api/math/h/radians.md b/docs/api/math/h/radians.md index a1c70771..cfb2cf79 100644 --- a/docs/api/math/h/radians.md +++ b/docs/api/math/h/radians.md @@ -9,7 +9,7 @@ float Radians(float degrees); **示例:** ```cpp -#include +#include float degrees = 90.0f; float radians = Math::Radians(degrees); diff --git a/docs/api/math/h/two-pi.md b/docs/api/math/h/two-pi.md index 77b8704f..1fc0947e 100644 --- a/docs/api/math/h/two-pi.md +++ b/docs/api/math/h/two-pi.md @@ -9,7 +9,7 @@ constexpr float TWO_PI = 6.28318530717958647692f; **示例:** ```cpp -#include +#include float fullCircleRadians = TWO_PI; ``` diff --git a/docs/api/math/math.md b/docs/api/math/math.md index d007fb1a..599234b9 100644 --- a/docs/api/math/math.md +++ b/docs/api/math/math.md @@ -44,8 +44,10 @@ Math 模块提供了一套完整的图形数学库,包括向量、矩阵、四 | [Sphere](sphere/sphere.md) | `Sphere.h` | 球体 | | [Box](box/box.md) | `Box.h` | 盒子 | | [Bounds](bounds/bounds.md) | `Bounds.h` | 轴对齐包围盒 | +| [OBB](obb/obb.md) | `AABB.h` | 有向包围盒 | | [Frustum](frustum/frustum.md) | `Frustum.h` | 视锥体 | | [Rect](rect/rect.md) | `Rect.h` | 二维矩形 | +| [RectInt](rectint/rectint.md) | `Rect.h` | 整数矩形 | ## 常量定义 diff --git a/docs/api/math/matrix4/decompose.md b/docs/api/math/matrix4/decompose.md index 9bd262cf..31a030b4 100644 --- a/docs/api/math/matrix4/decompose.md +++ b/docs/api/math/matrix4/decompose.md @@ -20,9 +20,9 @@ void Decompose(Vector3& translation, Quaternion& rotation, Vector3& scale) const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" -#include "XCEngine/Math/Quaternion.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" +#include "XCEngine/Core/Math/Quaternion.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/determinant.md b/docs/api/math/matrix4/determinant.md index 29a510e7..029f5efe 100644 --- a/docs/api/math/matrix4/determinant.md +++ b/docs/api/math/matrix4/determinant.md @@ -17,7 +17,7 @@ float Determinant() const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" +#include "XCEngine/Core/Math/Matrix4.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/get-rotation.md b/docs/api/math/matrix4/get-rotation.md index 6b9ec5f7..bbf9523e 100644 --- a/docs/api/math/matrix4/get-rotation.md +++ b/docs/api/math/matrix4/get-rotation.md @@ -17,8 +17,8 @@ Quaternion GetRotation() const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Quaternion.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Quaternion.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/get-scale.md b/docs/api/math/matrix4/get-scale.md index 5f5c08f6..42a1220a 100644 --- a/docs/api/math/matrix4/get-scale.md +++ b/docs/api/math/matrix4/get-scale.md @@ -17,8 +17,8 @@ Vector3 GetScale() const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/get-translation.md b/docs/api/math/matrix4/get-translation.md index 8f24a3eb..b83a4075 100644 --- a/docs/api/math/matrix4/get-translation.md +++ b/docs/api/math/matrix4/get-translation.md @@ -17,8 +17,8 @@ Vector3 GetTranslation() const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/identity.md b/docs/api/math/matrix4/identity.md index 625de5c6..e4d36c54 100644 --- a/docs/api/math/matrix4/identity.md +++ b/docs/api/math/matrix4/identity.md @@ -17,7 +17,7 @@ static Matrix4x4 Identity() **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" +#include "XCEngine/Core/Math/Matrix4.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/inverse.md b/docs/api/math/matrix4/inverse.md index 3185ac3e..98b3de00 100644 --- a/docs/api/math/matrix4/inverse.md +++ b/docs/api/math/matrix4/inverse.md @@ -17,7 +17,7 @@ Matrix4x4 Inverse() const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" +#include "XCEngine/Core/Math/Matrix4.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/lookat.md b/docs/api/math/matrix4/lookat.md index 24bc99b6..7cadda44 100644 --- a/docs/api/math/matrix4/lookat.md +++ b/docs/api/math/matrix4/lookat.md @@ -20,8 +20,8 @@ static Matrix4x4 LookAt(const Vector3& eye, const Vector3& target, const Vector3 **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/multiplypoint.md b/docs/api/math/matrix4/multiplypoint.md index e164e337..8cea9d15 100644 --- a/docs/api/math/matrix4/multiplypoint.md +++ b/docs/api/math/matrix4/multiplypoint.md @@ -18,8 +18,8 @@ Vector3 MultiplyPoint(const Vector3& v) const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/multiplyvector.md b/docs/api/math/matrix4/multiplyvector.md index 87ca5a7e..26c93662 100644 --- a/docs/api/math/matrix4/multiplyvector.md +++ b/docs/api/math/matrix4/multiplyvector.md @@ -18,8 +18,8 @@ Vector3 MultiplyVector(const Vector3& v) const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/operator_index.md b/docs/api/math/matrix4/operator_index.md index 013908c7..afc03e4a 100644 --- a/docs/api/math/matrix4/operator_index.md +++ b/docs/api/math/matrix4/operator_index.md @@ -19,7 +19,7 @@ const float* operator[](int row) const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" +#include "XCEngine/Core/Math/Matrix4.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/operator_mul.md b/docs/api/math/matrix4/operator_mul.md index e72f4e45..86b1ea2e 100644 --- a/docs/api/math/matrix4/operator_mul.md +++ b/docs/api/math/matrix4/operator_mul.md @@ -24,8 +24,8 @@ Vector4 operator*(const Vector4& v) const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector4.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector4.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/orthographic.md b/docs/api/math/matrix4/orthographic.md index 742869d4..633566b9 100644 --- a/docs/api/math/matrix4/orthographic.md +++ b/docs/api/math/matrix4/orthographic.md @@ -23,7 +23,7 @@ static Matrix4x4 Orthographic(float left, float right, float bottom, float top, **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" +#include "XCEngine/Core/Math/Matrix4.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/perspective.md b/docs/api/math/matrix4/perspective.md index deefe534..fccf8d19 100644 --- a/docs/api/math/matrix4/perspective.md +++ b/docs/api/math/matrix4/perspective.md @@ -21,7 +21,7 @@ static Matrix4x4 Perspective(float fov, float aspect, float near, float far) **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" +#include "XCEngine/Core/Math/Matrix4.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/rotation.md b/docs/api/math/matrix4/rotation.md index c9cdeb74..d4534271 100644 --- a/docs/api/math/matrix4/rotation.md +++ b/docs/api/math/matrix4/rotation.md @@ -18,9 +18,9 @@ static Matrix4x4 Rotation(const Quaternion& q) **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Quaternion.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Quaternion.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/rotationx.md b/docs/api/math/matrix4/rotationx.md index 4e08e6b3..4e95e976 100644 --- a/docs/api/math/matrix4/rotationx.md +++ b/docs/api/math/matrix4/rotationx.md @@ -18,8 +18,8 @@ static Matrix4x4 RotationX(float radians) **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/rotationy.md b/docs/api/math/matrix4/rotationy.md index 4caa54e7..2053c1c3 100644 --- a/docs/api/math/matrix4/rotationy.md +++ b/docs/api/math/matrix4/rotationy.md @@ -18,8 +18,8 @@ static Matrix4x4 RotationY(float radians) **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/rotationz.md b/docs/api/math/matrix4/rotationz.md index effc1e24..0343c09a 100644 --- a/docs/api/math/matrix4/rotationz.md +++ b/docs/api/math/matrix4/rotationz.md @@ -18,8 +18,8 @@ static Matrix4x4 RotationZ(float radians) **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/scale.md b/docs/api/math/matrix4/scale.md index fcd014bc..bab7092c 100644 --- a/docs/api/math/matrix4/scale.md +++ b/docs/api/math/matrix4/scale.md @@ -18,8 +18,8 @@ static Matrix4x4 Scale(const Vector3& v) **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/translation.md b/docs/api/math/matrix4/translation.md index a7c87442..68d877e9 100644 --- a/docs/api/math/matrix4/translation.md +++ b/docs/api/math/matrix4/translation.md @@ -18,8 +18,8 @@ static Matrix4x4 Translation(const Vector3& v) **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/transpose.md b/docs/api/math/matrix4/transpose.md index 1713b52c..2b3f8171 100644 --- a/docs/api/math/matrix4/transpose.md +++ b/docs/api/math/matrix4/transpose.md @@ -17,7 +17,7 @@ Matrix4x4 Transpose() const **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" +#include "XCEngine/Core/Math/Matrix4.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/trs.md b/docs/api/math/matrix4/trs.md index d524e207..f1627b1a 100644 --- a/docs/api/math/matrix4/trs.md +++ b/docs/api/math/matrix4/trs.md @@ -20,9 +20,9 @@ static Matrix4x4 TRS(const Vector3& translation, const Quaternion& rotation, con **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" -#include "XCEngine/Math/Vector3.h" -#include "XCEngine/Math/Quaternion.h" +#include "XCEngine/Core/Math/Matrix4.h" +#include "XCEngine/Core/Math/Vector3.h" +#include "XCEngine/Core/Math/Quaternion.h" using namespace XCEngine::Math; diff --git a/docs/api/math/matrix4/zero.md b/docs/api/math/matrix4/zero.md index 38ea17df..a8b33932 100644 --- a/docs/api/math/matrix4/zero.md +++ b/docs/api/math/matrix4/zero.md @@ -17,7 +17,7 @@ static Matrix4x4 Zero() **示例:** ```cpp -#include "XCEngine/Math/Matrix4.h" +#include "XCEngine/Core/Math/Matrix4.h" using namespace XCEngine::Math; diff --git a/docs/api/math/obb/obb.md b/docs/api/math/obb/obb.md index c534058f..9c876ca2 100644 --- a/docs/api/math/obb/obb.md +++ b/docs/api/math/obb/obb.md @@ -4,7 +4,7 @@ **类型**: `struct` -**头文件**: `XCEngine/Math/AABB.h` +**头文件**: `XCEngine/Core/Math/AABB.h` **描述**: 定向包围盒,支持任意方向旋转的盒状包围体 @@ -28,9 +28,9 @@ OBB 常用于碰撞检测、剔除运算和物理模拟等场景。 ## 使用示例 ```cpp -#include "AABB.h" -#include "Vector3.h" -#include "Matrix4.h" +#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/plane/constructor-default.md b/docs/api/math/plane/constructor-default.md index 78b176e1..92e4e6f1 100644 --- a/docs/api/math/plane/constructor-default.md +++ b/docs/api/math/plane/constructor-default.md @@ -15,7 +15,7 @@ Plane() **示例:** ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/plane/constructor.md b/docs/api/math/plane/constructor.md index 7a381950..d62bdd8b 100644 --- a/docs/api/math/plane/constructor.md +++ b/docs/api/math/plane/constructor.md @@ -19,8 +19,8 @@ Plane(const Vector3& normal, float distance) **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/plane/frompoints.md b/docs/api/math/plane/frompoints.md index 2656a2cf..0153fd8f 100644 --- a/docs/api/math/plane/frompoints.md +++ b/docs/api/math/plane/frompoints.md @@ -22,8 +22,8 @@ static Plane FromPoints(const Vector3& a, const Vector3& b, const Vector3& c) **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/plane/getclosestpoint.md b/docs/api/math/plane/getclosestpoint.md index 6b5b55b0..fb2cdd8c 100644 --- a/docs/api/math/plane/getclosestpoint.md +++ b/docs/api/math/plane/getclosestpoint.md @@ -18,8 +18,8 @@ Vector3 GetClosestPoint(const Vector3& point) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/plane/getdistancetopoint.md b/docs/api/math/plane/getdistancetopoint.md index 2bcb9027..5e5c9e5f 100644 --- a/docs/api/math/plane/getdistancetopoint.md +++ b/docs/api/math/plane/getdistancetopoint.md @@ -18,8 +18,8 @@ float GetDistanceToPoint(const Vector3& point) const **示例:** ```cpp -#include -#include +#include +#include #include using namespace XCEngine::Math; diff --git a/docs/api/math/plane/getside.md b/docs/api/math/plane/getside.md index b9c1d321..cdcfd2de 100644 --- a/docs/api/math/plane/getside.md +++ b/docs/api/math/plane/getside.md @@ -18,8 +18,8 @@ bool GetSide(const Vector3& point) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/plane/intersects.md b/docs/api/math/plane/intersects.md index d05ea593..dfbf187b 100644 --- a/docs/api/math/plane/intersects.md +++ b/docs/api/math/plane/intersects.md @@ -18,9 +18,9 @@ bool Intersects(const Sphere& sphere) const **示例:** ```cpp -#include -#include -#include +#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/dot.md b/docs/api/math/quaternion/dot.md index 15f15921..984f6f21 100644 --- a/docs/api/math/quaternion/dot.md +++ b/docs/api/math/quaternion/dot.md @@ -18,7 +18,7 @@ float Dot(const Quaternion& other) const; **示例:** ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/from-axis-angle.md b/docs/api/math/quaternion/from-axis-angle.md index bdc7e3a1..73859b4b 100644 --- a/docs/api/math/quaternion/from-axis-angle.md +++ b/docs/api/math/quaternion/from-axis-angle.md @@ -19,9 +19,9 @@ static Quaternion FromAxisAngle(const Vector3& axis, float radians); **示例:** ```cpp -#include -#include -#include +#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/from-euler-angles.md b/docs/api/math/quaternion/from-euler-angles.md index f5afd4e4..4e7293ab 100644 --- a/docs/api/math/quaternion/from-euler-angles.md +++ b/docs/api/math/quaternion/from-euler-angles.md @@ -22,9 +22,9 @@ static Quaternion FromEulerAngles(const Vector3& euler); **示例:** ```cpp -#include -#include -#include +#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/from-rotation-matrix.md b/docs/api/math/quaternion/from-rotation-matrix.md index 59c2bfe8..e2a0c063 100644 --- a/docs/api/math/quaternion/from-rotation-matrix.md +++ b/docs/api/math/quaternion/from-rotation-matrix.md @@ -18,8 +18,8 @@ static Quaternion FromRotationMatrix(const Matrix4x4& matrix); **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/identity.md b/docs/api/math/quaternion/identity.md index 1715110d..13c17041 100644 --- a/docs/api/math/quaternion/identity.md +++ b/docs/api/math/quaternion/identity.md @@ -15,7 +15,7 @@ static Quaternion Identity(); **示例:** ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/inverse.md b/docs/api/math/quaternion/inverse.md index 8b393f01..882f47fe 100644 --- a/docs/api/math/quaternion/inverse.md +++ b/docs/api/math/quaternion/inverse.md @@ -15,7 +15,7 @@ Quaternion Inverse() const; **示例:** ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/look-rotation.md b/docs/api/math/quaternion/look-rotation.md index c1c9ff39..422e8f57 100644 --- a/docs/api/math/quaternion/look-rotation.md +++ b/docs/api/math/quaternion/look-rotation.md @@ -19,8 +19,8 @@ static Quaternion LookRotation(const Vector3& forward, const Vector3& up = Vecto **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/magnitude.md b/docs/api/math/quaternion/magnitude.md index 32409009..4aa6f030 100644 --- a/docs/api/math/quaternion/magnitude.md +++ b/docs/api/math/quaternion/magnitude.md @@ -15,7 +15,7 @@ float Magnitude() const; **示例:** ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/normalize.md b/docs/api/math/quaternion/normalize.md index 40b1e330..de246118 100644 --- a/docs/api/math/quaternion/normalize.md +++ b/docs/api/math/quaternion/normalize.md @@ -18,7 +18,7 @@ static Quaternion Normalize(const Quaternion& q); **示例:** ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/normalized.md b/docs/api/math/quaternion/normalized.md index 1220ee5c..752e856e 100644 --- a/docs/api/math/quaternion/normalized.md +++ b/docs/api/math/quaternion/normalized.md @@ -15,7 +15,7 @@ Quaternion Normalized() const; **示例:** ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/operator-mul.md b/docs/api/math/quaternion/operator-mul.md index 79f7c071..4f5629bd 100644 --- a/docs/api/math/quaternion/operator-mul.md +++ b/docs/api/math/quaternion/operator-mul.md @@ -23,8 +23,8 @@ Vector3 operator*(const Quaternion& q, const Vector3& v); **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/slerp.md b/docs/api/math/quaternion/slerp.md index 4532d426..de582d03 100644 --- a/docs/api/math/quaternion/slerp.md +++ b/docs/api/math/quaternion/slerp.md @@ -20,9 +20,9 @@ static Quaternion Slerp(const Quaternion& a, const Quaternion& b, float t); **示例:** ```cpp -#include -#include -#include +#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/to-euler-angles.md b/docs/api/math/quaternion/to-euler-angles.md index 1231bc90..fc40a543 100644 --- a/docs/api/math/quaternion/to-euler-angles.md +++ b/docs/api/math/quaternion/to-euler-angles.md @@ -15,9 +15,9 @@ Vector3 ToEulerAngles() const; **示例:** ```cpp -#include -#include -#include +#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/quaternion/to-matrix4x4.md b/docs/api/math/quaternion/to-matrix4x4.md index 947804ec..c1bb51c8 100644 --- a/docs/api/math/quaternion/to-matrix4x4.md +++ b/docs/api/math/quaternion/to-matrix4x4.md @@ -15,8 +15,8 @@ Matrix4x4 ToMatrix4x4() const; **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/ray/getpoint.md b/docs/api/math/ray/getpoint.md index 029d4755..9cdb5de7 100644 --- a/docs/api/math/ray/getpoint.md +++ b/docs/api/math/ray/getpoint.md @@ -18,8 +18,8 @@ Vector3 GetPoint(float t) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/ray/intersects-box.md b/docs/api/math/ray/intersects-box.md index 1ef4c81e..d2448ba6 100644 --- a/docs/api/math/ray/intersects-box.md +++ b/docs/api/math/ray/intersects-box.md @@ -21,9 +21,9 @@ bool Intersects(const Box& box, float& t) const **示例:** ```cpp -#include -#include -#include +#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/ray/intersects-plane.md b/docs/api/math/ray/intersects-plane.md index 13d79ba0..55c22e26 100644 --- a/docs/api/math/ray/intersects-plane.md +++ b/docs/api/math/ray/intersects-plane.md @@ -21,9 +21,9 @@ bool Intersects(const Plane& plane, float& t) const **示例:** ```cpp -#include -#include -#include +#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/ray/intersects-sphere.md b/docs/api/math/ray/intersects-sphere.md index 886549e7..e0a69d7a 100644 --- a/docs/api/math/ray/intersects-sphere.md +++ b/docs/api/math/ray/intersects-sphere.md @@ -21,9 +21,9 @@ bool Intersects(const Sphere& sphere, float& t) const **示例:** ```cpp -#include -#include -#include +#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/ray/ray-constructor-default.md b/docs/api/math/ray/ray-constructor-default.md index 424fc958..fd5b4e42 100644 --- a/docs/api/math/ray/ray-constructor-default.md +++ b/docs/api/math/ray/ray-constructor-default.md @@ -15,7 +15,7 @@ Ray() = default **示例:** ```cpp -#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/ray/ray-constructor.md b/docs/api/math/ray/ray-constructor.md index b7999553..25bc56b6 100644 --- a/docs/api/math/ray/ray-constructor.md +++ b/docs/api/math/ray/ray-constructor.md @@ -19,8 +19,8 @@ Ray(const Vector3& origin, const Vector3& direction) **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/rect/contains.md b/docs/api/math/rect/contains.md index a49f722e..468c31a1 100644 --- a/docs/api/math/rect/contains.md +++ b/docs/api/math/rect/contains.md @@ -23,7 +23,7 @@ bool Contains(const Vector2& point) const; **示例:** ```cpp -#include "XCEngine/Math/Rect.h" +#include "XCEngine/Core/Math/Rect.h" #include using namespace XCEngine::Math; diff --git a/docs/api/math/rect/rect-overview.md b/docs/api/math/rect/rect-overview.md index df6561f4..7969038a 100644 --- a/docs/api/math/rect/rect-overview.md +++ b/docs/api/math/rect/rect-overview.md @@ -2,7 +2,7 @@ 浮点矩形结构体,用于 2D 区域表示。 -**头文件:** `#include ` +**头文件:** `#include ` **命名空间:** `XCEngine::Math` diff --git a/docs/api/math/rect/setposition.md b/docs/api/math/rect/setposition.md index 73253cf4..2eca0f83 100644 --- a/docs/api/math/rect/setposition.md +++ b/docs/api/math/rect/setposition.md @@ -21,8 +21,8 @@ void SetPosition(const Vector2& position); **示例:** ```cpp -#include "XCEngine/Math/Rect.h" -#include "XCEngine/Math/Vector2.h" +#include "XCEngine/Core/Math/Rect.h" +#include "XCEngine/Core/Math/Vector2.h" #include using namespace XCEngine::Math; diff --git a/docs/api/math/rectint/rectint.md b/docs/api/math/rectint/rectint.md index 8c6ecad7..9bc802e5 100644 --- a/docs/api/math/rectint/rectint.md +++ b/docs/api/math/rectint/rectint.md @@ -2,7 +2,7 @@ 整数矩形结构体,用于像素级 2D 区域表示。 -**头文件:** `#include ` +**头文件:** `#include ` **命名空间:** `XCEngine::Math` @@ -31,20 +31,20 @@ struct RectInt { | 方法 | 返回值 | 描述 | |------|--------|------| -| [GetLeft()](rectint-getleft.md) | `int32_t` | 左边界 | -| [GetRight()](rectint-getright.md) | `int32_t` | 右边界 | -| [GetTop()](rectint-gettop.md) | `int32_t` | 上边界 | -| [GetBottom()](rectint-getbottom.md) | `int32_t` | 下边界 | -| [GetPosition()](rectint-getposition.md) | `Vector2` | 位置(转换为浮点) | -| [GetSize()](rectint-getsize.md) | `Vector2` | 尺寸(转换为浮点) | -| [GetCenter()](rectint-getcenter.md) | `Vector2` | 中心点 | +| [GetLeft()](getleft.md) | `int32_t` | 左边界 | +| [GetRight()](getright.md) | `int32_t` | 右边界 | +| [GetTop()](gettop.md) | `int32_t` | 上边界 | +| [GetBottom()](getbottom.md) | `int32_t` | 下边界 | +| [GetPosition()](getposition.md) | `Vector2` | 位置(转换为浮点) | +| [GetSize()](getsize.md) | `Vector2` | 尺寸(转换为浮点) | +| [GetCenter()](getcenter.md) | `Vector2` | 中心点 | ## 检测方法 | 方法 | 返回值 | 描述 | |------|--------|------| -| [Contains(px, py)](rectint-contains.md) | `bool` | 整数坐标点检测 | -| [Intersects(other)](rectint-intersects.md) | `bool` | 与另一矩形相交 | +| [Contains(px, py)](contains.md) | `bool` | 整数坐标点检测 | +| [Intersects(other)](intersects.md) | `bool` | 与另一矩形相交 | ## 相关文档 diff --git a/docs/api/math/sphere/contains.md b/docs/api/math/sphere/contains.md index 50a98680..5e360f7c 100644 --- a/docs/api/math/sphere/contains.md +++ b/docs/api/math/sphere/contains.md @@ -18,8 +18,8 @@ bool Contains(const Vector3& point) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/sphere/intersects.md b/docs/api/math/sphere/intersects.md index 5f255a12..3a9edb7d 100644 --- a/docs/api/math/sphere/intersects.md +++ b/docs/api/math/sphere/intersects.md @@ -18,8 +18,8 @@ bool Intersects(const Sphere& other) const **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/sphere/sphere-constructor.md b/docs/api/math/sphere/sphere-constructor.md index 7e3302e9..a85a9e2b 100644 --- a/docs/api/math/sphere/sphere-constructor.md +++ b/docs/api/math/sphere/sphere-constructor.md @@ -19,8 +19,8 @@ Sphere(const Vector3& center, float radius) **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/sphere/sphere-default-constructor.md b/docs/api/math/sphere/sphere-default-constructor.md index 1a442afb..896826ba 100644 --- a/docs/api/math/sphere/sphere-default-constructor.md +++ b/docs/api/math/sphere/sphere-default-constructor.md @@ -15,8 +15,8 @@ Sphere() **示例:** ```cpp -#include -#include +#include +#include using namespace XCEngine::Math; diff --git a/docs/api/math/transform/inverse-transform-direction.md b/docs/api/math/transform/inverse-transform-direction.md index d29bd8f6..0cf7492d 100644 --- a/docs/api/math/transform/inverse-transform-direction.md +++ b/docs/api/math/transform/inverse-transform-direction.md @@ -20,8 +20,8 @@ Vector3 InverseTransformDirection(const Vector3& direction) const; **示例:** ```cpp -#include "XCEngine/Math/Transform.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Transform.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/transform/inverse-transform-point.md b/docs/api/math/transform/inverse-transform-point.md index 0b25cf70..adde5bec 100644 --- a/docs/api/math/transform/inverse-transform-point.md +++ b/docs/api/math/transform/inverse-transform-point.md @@ -20,8 +20,8 @@ Vector3 InverseTransformPoint(const Vector3& point) const; **示例:** ```cpp -#include "XCEngine/Math/Transform.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Transform.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/transform/inverse.md b/docs/api/math/transform/inverse.md index 1a03da5a..70add7a1 100644 --- a/docs/api/math/transform/inverse.md +++ b/docs/api/math/transform/inverse.md @@ -22,8 +22,8 @@ Transform Inverse() const; **示例:** ```cpp -#include "XCEngine/Math/Transform.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Transform.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/transform/operator-star.md b/docs/api/math/transform/operator-star.md index 28a935be..a4e1e5b8 100644 --- a/docs/api/math/transform/operator-star.md +++ b/docs/api/math/transform/operator-star.md @@ -23,8 +23,8 @@ Transform operator*(const Transform& other) const; **示例:** ```cpp -#include "XCEngine/Math/Transform.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Transform.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/transform/space.md b/docs/api/math/transform/space.md index 66915d7d..55ffb71e 100644 --- a/docs/api/math/transform/space.md +++ b/docs/api/math/transform/space.md @@ -4,7 +4,7 @@ **类型**: `enum class` -**头文件**: `XCEngine/Math/Transform.h` +**头文件**: `XCEngine/Core/Math/Transform.h` ## 概述 @@ -20,8 +20,8 @@ ## 使用示例 ```cpp -#include "XCEngine/Math/Transform.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Transform.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/transform/to-matrix.md b/docs/api/math/transform/to-matrix.md index 95ca6ea6..bc41895b 100644 --- a/docs/api/math/transform/to-matrix.md +++ b/docs/api/math/transform/to-matrix.md @@ -17,9 +17,9 @@ Matrix4 ToMatrix() const; **示例:** ```cpp -#include "XCEngine/Math/Transform.h" -#include "XCEngine/Math/Vector3.h" -#include "XCEngine/Math/Quaternion.h" +#include "XCEngine/Core/Math/Transform.h" +#include "XCEngine/Core/Math/Vector3.h" +#include "XCEngine/Core/Math/Quaternion.h" using namespace XCEngine::Math; diff --git a/docs/api/math/transform/transform-direction.md b/docs/api/math/transform/transform-direction.md index fba8495e..20de499b 100644 --- a/docs/api/math/transform/transform-direction.md +++ b/docs/api/math/transform/transform-direction.md @@ -20,8 +20,8 @@ Vector3 TransformDirection(const Vector3& direction) const; **示例:** ```cpp -#include "XCEngine/Math/Transform.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Transform.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/transform/transform-point.md b/docs/api/math/transform/transform-point.md index a0e32fc9..e44df38a 100644 --- a/docs/api/math/transform/transform-point.md +++ b/docs/api/math/transform/transform-point.md @@ -20,8 +20,8 @@ Vector3 TransformPoint(const Vector3& point) const; **示例:** ```cpp -#include "XCEngine/Math/Transform.h" -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Transform.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/math/vector3/project.md b/docs/api/math/vector3/project.md index 62aca087..5c88eb69 100644 --- a/docs/api/math/vector3/project.md +++ b/docs/api/math/vector3/project.md @@ -27,4 +27,4 @@ Vector3 projected = Vector3::Project(v, normal); // (1, 0, 0) ## 相关文档 - [Vector3 类总览](vector3.md) - 返回类总览 -- [`ProjectOnPlane`](projectonplane.md) - 投影到平面上 +- [`ProjectOnPlane`](project-on-plane.md) - 投影到平面上 diff --git a/docs/api/math/vector3/vector3-constructor.md b/docs/api/math/vector3/vector3-constructor.md index c2c426a9..966acc8e 100644 --- a/docs/api/math/vector3/vector3-constructor.md +++ b/docs/api/math/vector3/vector3-constructor.md @@ -21,7 +21,7 @@ constexpr Vector3(float x, float y, float z); **示例:** ```cpp -#include "XCEngine/Math/Vector3.h" +#include "XCEngine/Core/Math/Vector3.h" using namespace XCEngine::Math; diff --git a/docs/api/resources/mesh/meshsection.md b/docs/api/resources/mesh/meshsection.md index 73bd0c32..d1df4f3a 100644 --- a/docs/api/resources/mesh/meshsection.md +++ b/docs/api/resources/mesh/meshsection.md @@ -35,4 +35,4 @@ mesh.AddSection(section); ## 相关文档 - [Mesh 类总览](mesh.md) - 返回类总览 -- [AddSection](./addsection.md) - 添加网格分段 +- [AddSection](add-section.md) - 添加网格分段 diff --git a/docs/api/resources/mesh/vertexattribute.md b/docs/api/resources/mesh/vertexattribute.md index 39429d44..81f46be4 100644 --- a/docs/api/resources/mesh/vertexattribute.md +++ b/docs/api/resources/mesh/vertexattribute.md @@ -34,4 +34,4 @@ VertexAttribute attributes = VertexAttribute::Position | VertexAttribute::Normal ## 相关文档 - [Mesh 类总览](mesh.md) - 返回类总览 -- [SetVertexData](./setvertexdata.md) - 设置顶点数据 +- [SetVertexData](set-vertex-data.md) - 设置顶点数据 diff --git a/docs/api/resources/texture-import-settings/clone.md b/docs/api/resources/texture-import-settings/clone.md index 9b25c039..eed28b9c 100644 --- a/docs/api/resources/texture-import-settings/clone.md +++ b/docs/api/resources/texture-import-settings/clone.md @@ -22,4 +22,4 @@ auto cloned = settings.Clone(); ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/loadfromjson.md b/docs/api/resources/texture-import-settings/loadfromjson.md index 30efb7cc..f09f5ad4 100644 --- a/docs/api/resources/texture-import-settings/loadfromjson.md +++ b/docs/api/resources/texture-import-settings/loadfromjson.md @@ -25,4 +25,4 @@ bool success = settings.LoadFromJSON(R"({"textureType":1,"sRGB":true})"); ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/savetojson.md b/docs/api/resources/texture-import-settings/savetojson.md index d0970739..3efce2cb 100644 --- a/docs/api/resources/texture-import-settings/savetojson.md +++ b/docs/api/resources/texture-import-settings/savetojson.md @@ -23,4 +23,4 @@ Containers::String json = settings.SaveToJSON(); ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setbordercolor.md b/docs/api/resources/texture-import-settings/setbordercolor.md index c99dce5a..db746d85 100644 --- a/docs/api/resources/texture-import-settings/setbordercolor.md +++ b/docs/api/resources/texture-import-settings/setbordercolor.md @@ -24,4 +24,4 @@ const Math::Vector3& color = settings.GetBorderColor(); ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setcompressionquality.md b/docs/api/resources/texture-import-settings/setcompressionquality.md index adbaff55..0e008cd3 100644 --- a/docs/api/resources/texture-import-settings/setcompressionquality.md +++ b/docs/api/resources/texture-import-settings/setcompressionquality.md @@ -24,4 +24,4 @@ CompressionQuality quality = settings.GetCompressionQuality(); // CompressionQua ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setfliphhorizontal.md b/docs/api/resources/texture-import-settings/setfliphhorizontal.md index f1d9cb14..c04fdf5c 100644 --- a/docs/api/resources/texture-import-settings/setfliphhorizontal.md +++ b/docs/api/resources/texture-import-settings/setfliphhorizontal.md @@ -24,4 +24,4 @@ bool flip = settings.GetFlipHorizontal(); // true ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setflipvertical.md b/docs/api/resources/texture-import-settings/setflipvertical.md index 465088c6..598a6e92 100644 --- a/docs/api/resources/texture-import-settings/setflipvertical.md +++ b/docs/api/resources/texture-import-settings/setflipvertical.md @@ -24,4 +24,4 @@ bool flip = settings.GetFlipVertical(); // true ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setgeneratemipmaps.md b/docs/api/resources/texture-import-settings/setgeneratemipmaps.md index 13e4ad80..2b2d4b2e 100644 --- a/docs/api/resources/texture-import-settings/setgeneratemipmaps.md +++ b/docs/api/resources/texture-import-settings/setgeneratemipmaps.md @@ -24,4 +24,4 @@ bool generate = settings.GetGenerateMipmaps(); // true ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setgeneratenormalmap.md b/docs/api/resources/texture-import-settings/setgeneratenormalmap.md index e843ba57..437665e8 100644 --- a/docs/api/resources/texture-import-settings/setgeneratenormalmap.md +++ b/docs/api/resources/texture-import-settings/setgeneratenormalmap.md @@ -24,4 +24,4 @@ bool generate = settings.GetGenerateNormalMap(); // true ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setmaxanisotropy.md b/docs/api/resources/texture-import-settings/setmaxanisotropy.md index 204372f4..eb68c897 100644 --- a/docs/api/resources/texture-import-settings/setmaxanisotropy.md +++ b/docs/api/resources/texture-import-settings/setmaxanisotropy.md @@ -24,4 +24,4 @@ Core::uint32 anisotropy = settings.GetMaxAnisotropy(); // 16 ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setmaxsize.md b/docs/api/resources/texture-import-settings/setmaxsize.md index f9005c9c..985cf20e 100644 --- a/docs/api/resources/texture-import-settings/setmaxsize.md +++ b/docs/api/resources/texture-import-settings/setmaxsize.md @@ -24,4 +24,4 @@ Core::uint32 size = settings.GetMaxSize(); // 2048 ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setmipmapfilter.md b/docs/api/resources/texture-import-settings/setmipmapfilter.md index 77d7c413..9be6faa5 100644 --- a/docs/api/resources/texture-import-settings/setmipmapfilter.md +++ b/docs/api/resources/texture-import-settings/setmipmapfilter.md @@ -24,4 +24,4 @@ MipmapFilter filter = settings.GetMipmapFilter(); // MipmapFilter::Kaiser ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setnormalmapstrength.md b/docs/api/resources/texture-import-settings/setnormalmapstrength.md index 1598de38..8561139e 100644 --- a/docs/api/resources/texture-import-settings/setnormalmapstrength.md +++ b/docs/api/resources/texture-import-settings/setnormalmapstrength.md @@ -24,4 +24,4 @@ float strength = settings.GetNormalMapStrength(); // 2.0f ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/setsrgb.md b/docs/api/resources/texture-import-settings/setsrgb.md index 6ea7e6b0..fa74c87d 100644 --- a/docs/api/resources/texture-import-settings/setsrgb.md +++ b/docs/api/resources/texture-import-settings/setsrgb.md @@ -24,4 +24,4 @@ bool srgb = settings.GetSRGB(); // true ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/resources/texture-import-settings/settargetformat.md b/docs/api/resources/texture-import-settings/settargetformat.md index aabf9329..51e28cb8 100644 --- a/docs/api/resources/texture-import-settings/settargetformat.md +++ b/docs/api/resources/texture-import-settings/settargetformat.md @@ -24,5 +24,5 @@ TextureFormat format = settings.GetTargetFormat(); // TextureFormat::RGBA8 ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 - [Texture](../texture/texture.md) - 纹理格式定义 diff --git a/docs/api/resources/texture-import-settings/settexturetype.md b/docs/api/resources/texture-import-settings/settexturetype.md index 8602d10c..9ee480fc 100644 --- a/docs/api/resources/texture-import-settings/settexturetype.md +++ b/docs/api/resources/texture-import-settings/settexturetype.md @@ -24,5 +24,5 @@ TextureType type = settings.GetTextureType(); // TextureType::Texture2D ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 - [Texture](../texture/texture.md) - 纹理类型定义 diff --git a/docs/api/resources/texture-import-settings/setusehardwarecompression.md b/docs/api/resources/texture-import-settings/setusehardwarecompression.md index 5aa83098..658b430e 100644 --- a/docs/api/resources/texture-import-settings/setusehardwarecompression.md +++ b/docs/api/resources/texture-import-settings/setusehardwarecompression.md @@ -24,4 +24,4 @@ bool use = settings.GetUseHardwareCompression(); // true ## 相关文档 -- [TextureImportSettings 总览](textureimportsettings.md) - 返回类总览 +- [TextureImportSettings 总览](texture-import-settings.md) - 返回类总览 diff --git a/docs/api/rhi/d3d12/sampler/index.md b/docs/api/rhi/d3d12/sampler/index.md index 8c617f8b..f3670275 100644 --- a/docs/api/rhi/d3d12/sampler/index.md +++ b/docs/api/rhi/d3d12/sampler/index.md @@ -67,5 +67,4 @@ delete sampler; ## 相关文档 -- [RHISampler 基类](../RHISampler.md) -- [D3D12 枚举映射](./D3D12Enum.md) +- [RHISampler 基类](../../sampler/sampler.md) diff --git a/docs/api/rhi/device/create-shader.md b/docs/api/rhi/device/create-shader.md new file mode 100644 index 00000000..9cd82f6a --- /dev/null +++ b/docs/api/rhi/device/create-shader.md @@ -0,0 +1,34 @@ +# RHIDevice::CreateShader + +创建并编译一个着色器程序。 + +```cpp +virtual RHIShader* CreateShader(const ShaderCompileDesc& desc) = 0; +``` + +**参数:** +- `desc` - 着色器编译描述符,包含入口点、目标配置文件、源码或文件路径等 + +**返回:** 新创建的着色器指针,失败返回 `nullptr` + +**复杂度:** O(n) - 取决于着色器代码复杂度 + +**示例:** + +```cpp +ShaderCompileDesc shaderDesc; +shaderDesc.entryPoint = L"main"; +shaderDesc.profile = L"vs_6_0"; +shaderDesc.fileName = L"shaders/vertex.hlsl"; + +RHIShader* vertexShader = device->CreateShader(shaderDesc); +if (!vertexShader->IsValid()) { + // 处理编译错误 + vertexShader->Shutdown(); +} +``` + +## 相关文档 + +- [RHIDevice 总览](device.md) - 返回类总览 +- [RHIShader](../shader/shader.md) - 着色器类 diff --git a/docs/api/rhi/opengl/command-list/clear.md b/docs/api/rhi/opengl/command-list/clear.md index ce81213f..ddc0988b 100644 --- a/docs/api/rhi/opengl/command-list/clear.md +++ b/docs/api/rhi/opengl/command-list/clear.md @@ -43,4 +43,3 @@ commandList->Clear(0.0f, 0.0f, 0.0f, 1.0f, - [ClearDepth](clear-depth.md) - 仅清除深度缓冲区 - [ClearStencil](clear-stencil.md) - 仅清除模板缓冲区 - [ClearDepthStencil](clear-depth-stencil.md) - 清除深度和模板缓冲区 -- [ClearFlag 枚举](../../enums/clear-flag.md) - 清除缓冲区标志 diff --git a/docs/api/rhi/opengl/device/compile-shader.md b/docs/api/rhi/opengl/device/compile-shader.md index 1b441aad..bfa91ed8 100644 --- a/docs/api/rhi/opengl/device/compile-shader.md +++ b/docs/api/rhi/opengl/device/compile-shader.md @@ -70,4 +70,4 @@ RHIShader* fragmentShader = device.CompileShader(fsDesc); ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [OpenGLShader](../opengl-shader.md) - OpenGL 着色器实现 +- [OpenGLShader](../shader/shader.md) - OpenGL 着色器实现 diff --git a/docs/api/rhi/opengl/device/create-buffer.md b/docs/api/rhi/opengl/device/create-buffer.md index 7ee45bd6..28446f3e 100644 --- a/docs/api/rhi/opengl/device/create-buffer.md +++ b/docs/api/rhi/opengl/device/create-buffer.md @@ -64,4 +64,4 @@ RHIBuffer* indexBuffer = device.CreateBuffer(indexDesc); ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [OpenGLBuffer](../opengl-buffer.md) - OpenGL 缓冲区实现 +- [OpenGLBuffer](../buffer/buffer.md) - OpenGL 缓冲区实现 diff --git a/docs/api/rhi/opengl/device/create-command-list.md b/docs/api/rhi/opengl/device/create-command-list.md index 3ec31154..cdc318bc 100644 --- a/docs/api/rhi/opengl/device/create-command-list.md +++ b/docs/api/rhi/opengl/device/create-command-list.md @@ -46,4 +46,4 @@ cmdList->End(); ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [OpenGLCommandList](../opengl-command-list.md) - OpenGL 命令列表实现 +- [OpenGLCommandList](../command-list/command-list.md) - OpenGL 命令列表实现 diff --git a/docs/api/rhi/opengl/device/create-command-queue.md b/docs/api/rhi/opengl/device/create-command-queue.md index 6e4fe54e..92eff891 100644 --- a/docs/api/rhi/opengl/device/create-command-queue.md +++ b/docs/api/rhi/opengl/device/create-command-queue.md @@ -42,4 +42,4 @@ queue->ExecuteCommandList(cmdList); ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [OpenGLCommandQueue](../opengl-command-queue.md) - OpenGL 命令队列实现 +- [OpenGLCommandQueue](../command-queue/command-queue.md) - OpenGL 命令队列实现 diff --git a/docs/api/rhi/opengl/device/create-fence.md b/docs/api/rhi/opengl/device/create-fence.md index 16282d36..5dbfc431 100644 --- a/docs/api/rhi/opengl/device/create-fence.md +++ b/docs/api/rhi/opengl/device/create-fence.md @@ -53,4 +53,4 @@ while (!fence->IsSignaled()) { ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [OpenGLFence](../opengl-fence.md) - OpenGL 栅栏实现 +- [OpenGLFence](../fence/fence.md) - OpenGL 栅栏实现 diff --git a/docs/api/rhi/opengl/device/create-pipeline-state.md b/docs/api/rhi/opengl/device/create-pipeline-state.md index a12f41dd..66da60a6 100644 --- a/docs/api/rhi/opengl/device/create-pipeline-state.md +++ b/docs/api/rhi/opengl/device/create-pipeline-state.md @@ -50,4 +50,4 @@ pso->Bind(); ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [OpenGLPipelineState](../opengl-pipeline-state.md) - OpenGL 管线状态实现 +- [OpenGLPipelineState](../pipeline-state/pipeline-state.md) - OpenGL 管线状态实现 diff --git a/docs/api/rhi/opengl/device/create-sampler.md b/docs/api/rhi/opengl/device/create-sampler.md index c7ed62d1..870564e8 100644 --- a/docs/api/rhi/opengl/device/create-sampler.md +++ b/docs/api/rhi/opengl/device/create-sampler.md @@ -62,4 +62,4 @@ sampler->Bind(0); ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [OpenGLSampler](../opengl-sampler.md) - OpenGL 采样器实现 +- [OpenGLSampler](../sampler/sampler.md) - OpenGL 采样器实现 diff --git a/docs/api/rhi/opengl/device/create-swap-chain.md b/docs/api/rhi/opengl/device/create-swap-chain.md index 2be34e3f..c9750810 100644 --- a/docs/api/rhi/opengl/device/create-swap-chain.md +++ b/docs/api/rhi/opengl/device/create-swap-chain.md @@ -57,5 +57,5 @@ while (!device.ShouldClose()) { ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [OpenGLSwapChain](../opengl-swap-chain.md) - OpenGL 交换链实现 +- [OpenGLSwapChain](../swap-chain/swap-chain.md) - OpenGL 交换链实现 - [SwapBuffers](swap-buffers.md) - 交换缓冲区 diff --git a/docs/api/rhi/opengl/device/create-texture.md b/docs/api/rhi/opengl/device/create-texture.md index 08133d3b..2a684d44 100644 --- a/docs/api/rhi/opengl/device/create-texture.md +++ b/docs/api/rhi/opengl/device/create-texture.md @@ -78,4 +78,4 @@ RHITexture* texCube = device.CreateTexture(texCubeDesc); ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [OpenGLTexture](../opengl-texture.md) - OpenGL 纹理实现 +- [OpenGLTexture](../texture/texture.md) - OpenGL 纹理实现 diff --git a/docs/api/rhi/opengl/device/device.md b/docs/api/rhi/opengl/device/device.md index cfa3da5a..ec728f58 100644 --- a/docs/api/rhi/opengl/device/device.md +++ b/docs/api/rhi/opengl/device/device.md @@ -34,7 +34,7 @@ | [`CreateSwapChain`](create-swap-chain.md) | 创建交换链 | | [`CreateCommandList`](create-command-list.md) | 创建命令列表 | | [`CreateCommandQueue`](create-command-queue.md) | 创建命令队列 | -| [`CreateShader`](create-shader.md) | 创建着色器 | +| [`CreateShader`](../../device/create-shader.md) | 创建着色器 | | [`CreatePipelineState`](create-pipeline-state.md) | 创建管线状态 | | [`CreateFence`](create-fence.md) | 创建栅栏 | | [`CreateSampler`](create-sampler.md) | 创建采样器 | diff --git a/docs/api/rhi/opengl/device/get-device-info.md b/docs/api/rhi/opengl/device/get-device-info.md index 656ef1f1..32976147 100644 --- a/docs/api/rhi/opengl/device/get-device-info.md +++ b/docs/api/rhi/opengl/device/get-device-info.md @@ -48,6 +48,6 @@ std::cout << "GL Version: " << info.majorVersion << "." << info.minorVersion << ## 相关文档 - [OpenGLDevice](device.md) - 类总览 -- [RHIDeviceInfo](../../types/device-info.md) - 设备信息结构定义 +- [RHIDeviceInfo](../../types/types.md) - 设备信息结构定义 - [GetCapabilities](get-capabilities.md) - 获取设备能力 - [GetDeviceInfoImpl](get-device-info-impl.md) - 获取设备信息实现 diff --git a/docs/api/rhi/opengl/device/get-native-context.md b/docs/api/rhi/opengl/device/get-native-context.md new file mode 100644 index 00000000..3133437e --- /dev/null +++ b/docs/api/rhi/opengl/device/get-native-context.md @@ -0,0 +1,13 @@ +# OpenGLDevice::GetNativeContext + +获取 OpenGL 渲染上下文句柄。 + +```cpp +void* GetNativeContext() const; +``` + +**返回:** `void*` - OpenGL 渲染上下文句柄(HGLRC) + +## 相关文档 + +- [OpenGLDevice 总览](device.md) diff --git a/docs/api/rhi/opengl/device/make-context-current.md b/docs/api/rhi/opengl/device/make-context-current.md new file mode 100644 index 00000000..8a844503 --- /dev/null +++ b/docs/api/rhi/opengl/device/make-context-current.md @@ -0,0 +1,13 @@ +# OpenGLDevice::MakeContextCurrent + +使 OpenGL 上下文成为当前线程的活跃渲染上下文。 + +```cpp +bool MakeContextCurrent(); +``` + +**返回:** `bool` - 成功返回 true + +## 相关文档 + +- [OpenGLDevice 总览](device.md) diff --git a/docs/api/rhi/opengl/swap-chain/initialize.md b/docs/api/rhi/opengl/swap-chain/initialize.md index bd19bedb..033c80ff 100644 --- a/docs/api/rhi/opengl/swap-chain/initialize.md +++ b/docs/api/rhi/opengl/swap-chain/initialize.md @@ -1,22 +1,26 @@ # OpenGLSwapChain::Initialize +使用已存在的窗口初始化 OpenGL 交换链。 + ```cpp -bool Initialize(GLFWwindow* window, bool vsync = true); +bool Initialize(OpenGLDevice* device, HWND window, int width, int height); ``` -初始化 OpenGL 交换链。 - **参数:** -- `window` - GLFW 窗口指针 -- `vsync` - 是否启用垂直同步 +- `device` - OpenGL 设备指针 +- `window` - Win32 窗口句柄 +- `width` - 窗口宽度 +- `height` - 窗口高度 -**返回:** 成功返回 true +**返回:** 成功初始化返回 true **示例:** ```cpp +OpenGLDevice device; +device.Initialize({}); OpenGLSwapChain swapChain; -swapChain.Initialize(window, true); +swapChain.Initialize(&device, hwnd, 1280, 720); ``` ## 相关文档