Fixed broken references: - texture-import-settings: Fix 16 files referencing wrong overview filename - math/rectint: Fix 9 method links (rectint-* → get*, contains, intersects) - rhi/opengl/device: Fix 8 cross-references (opengl-* → */**) - resources/mesh: Fix meshsection and vertexattribute links - rhi/d3d12/sampler: Fix RHISampler reference path - math/vector3: Fix projectonplane → project-on-plane - rhi/opengl/command-list: Remove broken ClearFlag enum ref - rhi/opengl/device: Create 2 new method docs (MakeContextCurrent, GetNativeContext) - rhi/device: Fix device-info types reference All 0 broken references remaining.
1.5 KiB
1.5 KiB
OpenGLCommandList::Clear
void Clear(float r, float g, float b, float a, unsigned int buffers)
清除指定的缓冲区。
参数:
r- 清除颜色红色分量(范围 0.0f - 1.0f)g- 清除颜色绿色分量(范围 0.0f - 1.0f)b- 清除颜色蓝色分量(范围 0.0f - 1.0f)a- 清除颜色 Alpha 分量(范围 0.0f - 1.0f)buffers- 要清除的缓冲区标志,使用ClearFlag枚举值的位或组合:ClearFlag::Color(1) - 清除颜色缓冲区ClearFlag::Depth(2) - 清除深度缓冲区ClearFlag::Stencil(4) - 清除模板缓冲区
返回值:无
示例:
// 清除颜色缓冲区
commandList->Clear(0.0f, 0.0f, 0.0f, 1.0f, static_cast<unsigned int>(ClearFlag::Color));
// 清除颜色和深度缓冲区
commandList->Clear(0.0f, 0.0f, 0.0f, 1.0f,
static_cast<unsigned int>(ClearFlag::Color) |
static_cast<unsigned int>(ClearFlag::Depth));
// 清除所有缓冲区
commandList->Clear(0.0f, 0.0f, 0.0f, 1.0f,
static_cast<unsigned int>(ClearFlag::Color) |
static_cast<unsigned int>(ClearFlag::Depth) |
static_cast<unsigned int>(ClearFlag::Stencil));
相关文档
- OpenGLCommandList 总览 - 返回类总览
- ClearColor - 仅清除颜色缓冲区
- ClearDepth - 仅清除深度缓冲区
- ClearStencil - 仅清除模板缓冲区
- ClearDepthStencil - 清除深度和模板缓冲区