Files
XCEngine/docs/api/rhi/opengl/swap-chain/get-current-back-buffer.md
2026-03-20 02:35:45 +08:00

29 lines
700 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.
# OpenGLSwapChain::GetCurrentBackBuffer
```cpp
RHITexture* GetCurrentBackBuffer() override;
```
获取当前后台缓冲区纹理对象。
**返回:** `nullptr`OpenGL 交换链不支持此方法)
**线程安全:**
**注意:**
- OpenGL 交换链基于 GLFW 窗口,不提供独立的后台缓冲区纹理
- 该方法继承自 `RHISwapChain` 抽象接口
- 如需渲染到纹理,请使用 Framebuffer Object (FBO)
**示例:**
```cpp
RHITexture* backBuffer = swapChain->GetCurrentBackBuffer();
// 返回 nullptr
```
## 相关文档
- [OpenGLSwapChain 总览](swap-chain.md)
- [GetCurrentBackBufferIndex](get-current-back-buffer-index.md) - 获取当前后台缓冲区索引