Files
XCEngine/docs/api/rhi/command-list/set-viewport.md
2026-03-20 02:35:45 +08:00

762 B
Raw Blame History

RHICommandList::SetViewport

virtual void SetViewport(const Viewport& viewport) = 0;

设置渲染区域视口。视口定义了渲染输出到目标区域的映射变换。

参数:

  • viewport - 视口结构体(包含 topLeftX、topLeftY、width、height、minDepth、maxDepth

返回: void

异常:

线程安全:

复杂度: O(1)

示例:

Viewport vp;
vp.topLeftX = 0;
vp.topLeftY = 0;
vp.width = 1280;
vp.height = 720;
vp.minDepth = 0.0f;
vp.maxDepth = 1.0f;
cmdList->SetViewport(vp);

相关文档