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
This commit is contained in:
28
docs/api/rhi/opengl/device/create-render-window.md
Normal file
28
docs/api/rhi/opengl/device/create-render-window.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# OpenGLDevice::CreateRenderWindow
|
||||
|
||||
```cpp
|
||||
bool CreateRenderWindow(int width, int height, const char* title, bool enableDebug = false)
|
||||
```
|
||||
|
||||
创建并初始化一个新的 GLFW 窗口,同时初始化 OpenGL 上下文。
|
||||
|
||||
**参数:**
|
||||
- `width` - 窗口宽度(像素)
|
||||
- `height` - 窗口高度(像素)
|
||||
- `title` - 窗口标题
|
||||
- `enableDebug` - 是否启用 OpenGL 调试上下文(可选,默认为 false)
|
||||
|
||||
**返回:** `bool` - 成功返回 true,失败返回 false
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
OpenGLDevice device;
|
||||
if (device.CreateRenderWindow(1280, 720, "XCEngine", false)) {
|
||||
// 窗口创建成功,可以开始渲染循环
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLDevice](device.md) - 返回类总览
|
||||
37
docs/api/rhi/opengl/device/device.md
Normal file
37
docs/api/rhi/opengl/device/device.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# OpenGLDevice
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**描述**: OpenGL 设备的实现,继承自 `RHIDevice`。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Initialize`](../../../threading/task-system/initialize.md) | 初始化设备 |
|
||||
| [`Shutdown`](../../../threading/task-system/shutdown.md) | 关闭设备 |
|
||||
| [`CreateRenderWindow`](create-render-window.md) | 创建渲染窗口 |
|
||||
| [`InitializeWithExistingWindow`](initialize-with-existing-window.md) | 使用现有窗口初始化 |
|
||||
| [`GetWindow`](get-window.md) | 获取窗口 |
|
||||
| [`SwapBuffers`](swap-buffers.md) | 交换缓冲 |
|
||||
| [`PollEvents`](poll-events.md) | 处理窗口事件 |
|
||||
| [`SetShouldClose`](set-should-close.md) | 设置关闭标志 |
|
||||
| [`ShouldClose`](should-close.md) | 检查是否应关闭 |
|
||||
| [`CreateBuffer`](../../device/create-buffer.md) | 创建缓冲区 |
|
||||
| [`CreateTexture`](../../device/create-texture.md) | 创建纹理 |
|
||||
| [`CreateSwapChain`](../../device/create-swap-chain.md) | 创建交换链 |
|
||||
| [`CreateCommandList`](../../device/create-command-list.md) | 创建命令列表 |
|
||||
| [`CreateCommandQueue`](../../device/create-command-queue.md) | 创建命令队列 |
|
||||
| [`CompileShader`](../../device/compile-shader.md) | 编译着色器 |
|
||||
| [`CreatePipelineState`](../../device/create-pipeline-state.md) | 创建管线状态 |
|
||||
| [`CreateFence`](../../device/create-fence.md) | 创建栅栏 |
|
||||
| [`CreateSampler`](../../device/create-sampler.md) | 创建采样器 |
|
||||
| [`GetCapabilities`](../../device/get-capabilities.md) | 获取设备能力 |
|
||||
| [`GetDeviceInfo`](../../device/get-device-info.md) | 获取设备信息 |
|
||||
| [`GetNativeDevice`](../../device/get-native-device.md) | 获取原生设备 |
|
||||
| [`GetNativeHandle`](../../buffer/get-native-handle.md) | 获取原生句柄 |
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGL 后端总览](../overview.md)
|
||||
- [RHIDevice](../../device/device.md) - 抽象设备接口
|
||||
22
docs/api/rhi/opengl/device/get-window.md
Normal file
22
docs/api/rhi/opengl/device/get-window.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# OpenGLDevice::GetWindow
|
||||
|
||||
```cpp
|
||||
GLFWwindow* GetWindow() const
|
||||
```
|
||||
|
||||
获取关联的 GLFW 窗口指针。
|
||||
|
||||
**返回:** `GLFWwindow*` - GLFW 窗口指针
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
GLFWwindow* window = device.GetWindow();
|
||||
if (window) {
|
||||
glfwSetWindowTitle(window, "New Title");
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLDevice](device.md) - 返回类总览
|
||||
@@ -0,0 +1,26 @@
|
||||
# OpenGLDevice::InitializeWithExistingWindow
|
||||
|
||||
```cpp
|
||||
bool InitializeWithExistingWindow(GLFWwindow* window)
|
||||
```
|
||||
|
||||
使用已有的 GLFW 窗口初始化 OpenGL 设备,不会创建新窗口或管理窗口生命周期。
|
||||
|
||||
**参数:**
|
||||
- `window` - 已存在的 GLFWwindow 指针
|
||||
|
||||
**返回:** `bool` - 成功返回 true,失败返回 false
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
GLFWwindow* existingWindow = glfwCreateWindow(1280, 720, "Existing", nullptr, nullptr);
|
||||
OpenGLDevice device;
|
||||
if (device.InitializeWithExistingWindow(existingWindow)) {
|
||||
// 使用已有窗口初始化设备
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLDevice](device.md) - 返回类总览
|
||||
23
docs/api/rhi/opengl/device/poll-events.md
Normal file
23
docs/api/rhi/opengl/device/poll-events.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# OpenGLDevice::PollEvents
|
||||
|
||||
```cpp
|
||||
bool PollEvents()
|
||||
```
|
||||
|
||||
处理所有挂起的 GLFW 事件(窗口事件、输入事件等)。
|
||||
|
||||
**返回:** `bool` - 如果窗口应保持打开返回 true,如果窗口应关闭返回 false
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
while (device.PollEvents()) {
|
||||
// 渲染和交换缓冲区
|
||||
renderScene();
|
||||
device.SwapBuffers();
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLDevice](device.md) - 返回类总览
|
||||
20
docs/api/rhi/opengl/device/set-should-close.md
Normal file
20
docs/api/rhi/opengl/device/set-should-close.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# OpenGLDevice::SetShouldClose
|
||||
|
||||
```cpp
|
||||
void SetShouldClose(bool shouldClose)
|
||||
```
|
||||
|
||||
设置窗口是否应该关闭的标志。
|
||||
|
||||
**参数:**
|
||||
- `shouldClose` - true 表示窗口应该关闭,false 表示保持打开
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
device.SetShouldClose(true); // 请求关闭窗口
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLDevice](device.md) - 返回类总览
|
||||
23
docs/api/rhi/opengl/device/should-close.md
Normal file
23
docs/api/rhi/opengl/device/should-close.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# OpenGLDevice::ShouldClose
|
||||
|
||||
```cpp
|
||||
bool ShouldClose() const
|
||||
```
|
||||
|
||||
检查窗口是否应该关闭。
|
||||
|
||||
**返回:** `bool` - 如果窗口应该关闭返回 true,否则返回 false
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
while (!device.ShouldClose()) {
|
||||
device.PollEvents();
|
||||
renderScene();
|
||||
device.SwapBuffers();
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLDevice](device.md) - 返回类总览
|
||||
19
docs/api/rhi/opengl/device/swap-buffers.md
Normal file
19
docs/api/rhi/opengl/device/swap-buffers.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# OpenGLDevice::SwapBuffers
|
||||
|
||||
```cpp
|
||||
void SwapBuffers()
|
||||
```
|
||||
|
||||
交换前后缓冲区,将渲染内容显示到屏幕上。
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 渲染完成后交换缓冲区
|
||||
renderScene();
|
||||
device.SwapBuffers();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLDevice](device.md) - 返回类总览
|
||||
Reference in New Issue
Block a user