42 lines
716 B
Markdown
42 lines
716 B
Markdown
# OpenGLFence::GetCurrentValue
|
|
|
|
```cpp
|
|
uint64_t GetCurrentValue() const;
|
|
```
|
|
|
|
获取栅栏的当前值。
|
|
|
|
## 详细描述
|
|
|
|
返回 `m_fenceValue`,表示栅栏的最新值。每次调用 `Signal()` 时更新。
|
|
|
|
## 参数
|
|
|
|
无
|
|
|
|
## 返回值
|
|
|
|
| 类型 | 描述 |
|
|
|------|------|
|
|
| `uint64_t` | 当前栅栏值 |
|
|
|
|
## 示例
|
|
|
|
```cpp
|
|
OpenGLFence fence;
|
|
fence.Initialize(false);
|
|
|
|
uint64_t initial = fence.GetCurrentValue(); // 0
|
|
|
|
fence.Signal();
|
|
uint64_t afterSignal = fence.GetCurrentValue(); // 1
|
|
|
|
fence.Signal(10);
|
|
uint64_t afterValue = fence.GetCurrentValue(); // 10
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [OpenGLFence 总览](fence.md) - 返回类总览
|
|
- [GetCompletedValue](get-completed-value.md) - 获取已完成的栅栏值
|