Files
XCEngine/docs/api/rhi/framebuffer/get-native-handle.md
ssdfasd 1cf744b755 refactor(docs): RHI模块文档重构 - 修复18处链接错误并新增RHIFramebuffer/RHIRenderPass文档
- 修复opengl/下13个文件对overview.md的错误引用,改为opengl.md
- 修复opengl/shader/下2处get-native-handle.md的错误路径引用
- 修复rhi.md中rhifactory路径错误
- 修复opengl.md中对d3d12.md的错误引用
- 修复opengl/README.md中的overview.md引用
- 新增RHIFramebuffer完整文档(7个文件)
- 新增RHIRenderPass完整文档(7个文件)
- 更新rhi.md总览页,添加RHIFramebuffer和RHIRenderPass分类
2026-03-26 01:29:00 +08:00

26 lines
573 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.
# RHIFramebuffer::GetNativeHandle
获取帧缓冲的原生句柄。
```cpp
virtual void* GetNativeHandle() = 0;
```
返回底层图形 API 的帧缓冲句柄。不同后端返回不同类型:
- OpenGL: 返回 `GLuint`(帧缓冲对象 ID
- D3D12: 返回 `ID3D12Resource*` 指针
**返回:** `void*` - 原生句柄
**线程安全:**
**示例:**
```cpp
void* handle = framebuffer->GetNativeHandle();
#ifdef XCENGINE_OPENGL
GLuint fbo = static_cast<GLuint>(reinterpret_cast<intptr_t>(handle));
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
#endif
```