|
ObjectivelyGPU
Object oriented graphics framework for SDL3 and C
|
An SDL_GPUFence, signaled once a submitted CommandBuffer's GPU work completes.
More...
#include <Fence.h>
Public Member Functions | |
| Fence * | initWithDevice (Fence *self, RenderDevice *device, SDL_GPUFence *fence) |
Initializes this Fence, wrapping an SDL_GPUFence returned by CommandBuffer::submitAndFence. | |
| bool | query (const Fence *self) |
| Non-blocking query of whether this fence has been signaled. | |
| bool | wait (const Fence *self) |
| Blocks the calling thread until this fence is signaled. | |
| Class * | _Fence (void) |
| The Fence archetype. | |
Data Fields | |
| Object | object |
| The superclass. | |
| SDL_GPUFence * | fence |
| The underlying SDL fence. | |
Protected Attributes | |
| FenceInterface * | interface |
| The interface. | |
An SDL_GPUFence, signaled once a submitted CommandBuffer's GPU work completes.
Fence owns its underlying SDL_GPUFence and releases it in dealloc, so a Fence is freed with release like any other Objectively object – e.g. by storing pending fences in an Array, which releases each element automatically as it's removed:
| Fence * initWithDevice | ( | Fence * | self, |
| RenderDevice * | device, | ||
| SDL_GPUFence * | fence | ||
| ) |
Initializes this Fence, wrapping an SDL_GPUFence returned by CommandBuffer::submitAndFence.
This is the designated initializer.
| self | The Fence. |
| device | The RenderDevice used to query, wait on, and release the fence. Retained. |
| fence | The SDL_GPUFence to wrap. Owned by the returned Fence. |
NULL on error. | bool query | ( | const Fence * | self | ) |
Non-blocking query of whether this fence has been signaled.
| self | The Fence. |
true if signaled (the GPU work it guards has completed); false otherwise. | bool wait | ( | const Fence * | self | ) |
Blocks the calling thread until this fence is signaled.
| self | The Fence. |
true on success, false on error. | SDL_GPUFence* Fence::fence |
The underlying SDL fence.
|
protected |
The interface.
| Object Fence::object |
The superclass.