docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录 - 重命名 index.md 为 main.md - 修正所有模块文档中的错误: - math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式 - containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节 - core: 修复 types 链接错误 - debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI - memory: 修复头文件路径, malloc vs operator new, 新增方法文档 - resources: 修复 Shader/Texture 链接错误 - threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接 - 验证: fix_links.py 确认 0 个断裂引用
This commit is contained in:
28
docs/api/rhi/opengl/vertex-array/add-vertex-buffer.md
Normal file
28
docs/api/rhi/opengl/vertex-array/add-vertex-buffer.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# OpenGLVertexArray::AddVertexBuffer
|
||||
|
||||
```cpp
|
||||
void AddVertexBuffer(unsigned int buffer, const VertexAttribute& attribute)
|
||||
```
|
||||
|
||||
添加顶点缓冲区并指定顶点属性。
|
||||
|
||||
**参数:**
|
||||
- `buffer` - OpenGL 缓冲区对象 ID
|
||||
- `attribute` - 顶点属性描述结构体
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
VertexAttribute attr;
|
||||
attr.index = 0;
|
||||
attr.count = 3;
|
||||
attr.type = GL_FLOAT;
|
||||
attr.normalized = GL_FALSE;
|
||||
attr.stride = sizeof(Vertex);
|
||||
attr.offset = 0;
|
||||
vao.AddVertexBuffer(vbo, attr);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLVertexArray](vertex-array.md) - 返回类总览
|
||||
20
docs/api/rhi/opengl/vertex-array/get-id.md
Normal file
20
docs/api/rhi/opengl/vertex-array/get-id.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# OpenGLVertexArray::GetID
|
||||
|
||||
```cpp
|
||||
unsigned int GetID() const
|
||||
```
|
||||
|
||||
获取 OpenGL 顶点数组对象 ID。
|
||||
|
||||
**返回:** `unsigned int` - VAO ID
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
unsigned int vaoID = vao.GetID();
|
||||
glBindVertexArray(vaoID);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLVertexArray](vertex-array.md) - 返回类总览
|
||||
19
docs/api/rhi/opengl/vertex-array/get-index-buffer.md
Normal file
19
docs/api/rhi/opengl/vertex-array/get-index-buffer.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# OpenGLVertexArray::GetIndexBuffer
|
||||
|
||||
```cpp
|
||||
unsigned int GetIndexBuffer() const
|
||||
```
|
||||
|
||||
获取索引缓冲区 ID。
|
||||
|
||||
**返回:** `unsigned int` - 索引缓冲区 ID
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
unsigned int ibo = vao.GetIndexBuffer();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLVertexArray](vertex-array.md) - 返回类总览
|
||||
20
docs/api/rhi/opengl/vertex-array/get-index-count.md
Normal file
20
docs/api/rhi/opengl/vertex-array/get-index-count.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# OpenGLVertexArray::GetIndexCount
|
||||
|
||||
```cpp
|
||||
unsigned int GetIndexCount() const
|
||||
```
|
||||
|
||||
获取索引数量。
|
||||
|
||||
**返回:** `unsigned int` - 索引数量
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
unsigned int count = vao.GetIndexCount();
|
||||
glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_INT, 0);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLVertexArray](vertex-array.md) - 返回类总览
|
||||
21
docs/api/rhi/opengl/vertex-array/set-index-buffer.md
Normal file
21
docs/api/rhi/opengl/vertex-array/set-index-buffer.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# OpenGLVertexArray::SetIndexBuffer
|
||||
|
||||
```cpp
|
||||
void SetIndexBuffer(unsigned int buffer, unsigned int type)
|
||||
```
|
||||
|
||||
设置索引缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `buffer` - OpenGL 缓冲区对象 ID
|
||||
- `type` - 索引数据类型(GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_UNSIGNED_INT)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
vao.SetIndexBuffer(ibo, GL_UNSIGNED_INT);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLVertexArray](vertex-array.md) - 返回类总览
|
||||
23
docs/api/rhi/opengl/vertex-array/vertex-array.md
Normal file
23
docs/api/rhi/opengl/vertex-array/vertex-array.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# OpenGLVertexArray
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: OpenGL 顶点数组对象 (VAO) 封装。
|
||||
|
||||
## 方法列表
|
||||
|
||||
| 方法 | 文档 |
|
||||
|------|------|
|
||||
| `Initialize` | [详细文档](../../../threading/task-system/initialize.md) |
|
||||
| `AddVertexBuffer` | [详细文档](add-vertex-buffer.md) |
|
||||
| `SetIndexBuffer` | [详细文档](set-index-buffer.md) |
|
||||
| `Shutdown` | [详细文档](../../../threading/task-system/shutdown.md) |
|
||||
| `Bind` | [详细文档](../../shader/bind.md) |
|
||||
| `Unbind` | [详细文档](../../shader/unbind.md) |
|
||||
| `GetID` | [详细文档](get-id.md) |
|
||||
| `GetIndexBuffer` | [详细文档](get-index-buffer.md) |
|
||||
| `GetIndexCount` | [详细文档](get-index-count.md) |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGL 后端总览](../overview.md)
|
||||
Reference in New Issue
Block a user