30 lines
601 B
Markdown
30 lines
601 B
Markdown
# D3D12Common::CreateScissorRect
|
|
|
|
```cpp
|
|
inline D3D12_RECT CreateScissorRect(int left, int top, int right, int bottom)
|
|
```
|
|
|
|
创建裁剪矩形(剪刀矩形)。
|
|
|
|
**参数:**
|
|
- `left` - 矩形左边界
|
|
- `top` - 矩形上边界
|
|
- `right` - 矩形右边界
|
|
- `bottom` - 矩形下边界
|
|
|
|
**返回:** 配置好的 `D3D12_RECT` 结构
|
|
|
|
**线程安全:** ✅(纯函数)
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
D3D12_RECT scissorRect = CreateScissorRect(0, 0, 1280, 720);
|
|
cmdList->RSSetScissorRects(1, &scissorRect);
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [D3D12Common 总览](common.md)
|
|
- [CreateViewport](create-viewport.md)
|