Files
XCEngine/docs/api/rhi/opengl/device/get-native-handle.md
2026-03-20 02:35:45 +08:00

27 lines
619 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OpenGLDevice::GetNativeHandle
```cpp
void* GetNativeHandle() const
```
获取原生窗口或渲染上下文句柄。
**返回:** `void*` - 原生句柄(当前实现返回 `nullptr`
**复杂度:** O(1)
**注意:** 此方法当前实现返回 `nullptr`。使用 `GetWindow()` 获取 GLFW 窗口指针。
**示例:**
```cpp
void* handle = device.GetNativeHandle();
// 注意:当前实现返回 nullptr
GLFWwindow* window = device.GetWindow(); // 使用此方法获取窗口
```
## 相关文档
- [OpenGLDevice](device.md) - 返回类总览
- [GetWindow](get-window.md) - 获取 GLFW 窗口指针