docs: update RHI API docs
This commit is contained in:
35
docs/api/rhi/opengl/device/get-native-device.md
Normal file
35
docs/api/rhi/opengl/device/get-native-device.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# OpenGLDevice::GetNativeDevice
|
||||
|
||||
```cpp
|
||||
void* GetNativeDevice() override
|
||||
```
|
||||
|
||||
获取原生图形设备指针。
|
||||
|
||||
## 详细描述
|
||||
|
||||
返回原生图形 API 的设备指针。OpenGL 是一种状态机模型,没有传统意义上的"设备"对象,因此此方法返回 `nullptr`。
|
||||
|
||||
## 返回值
|
||||
|
||||
`void*` - 始终返回 `nullptr`(OpenGL 无原生设备对象)
|
||||
|
||||
## 注意事项
|
||||
|
||||
- OpenGL 使用隐式状态机模式,不需要显式的设备对象
|
||||
- 如需获取 OpenGL 上下文相关信息,使用 `GetCapabilities()` 或 `GetDeviceInfo()`
|
||||
- 如需获取窗口句柄,使用 `GetWindow()` 方法
|
||||
|
||||
## 示例
|
||||
|
||||
```cpp
|
||||
void* native = device.GetNativeDevice();
|
||||
// 注意:当前实现返回 nullptr
|
||||
// OpenGL 为状态机,无需设备对象
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLDevice](device.md) - 类总览
|
||||
- [GetWindow](get-window.md) - 获取 GLFW 窗口
|
||||
- [GetCapabilities](get-capabilities.md) - 获取设备能力
|
||||
Reference in New Issue
Block a user