XLE
v0.02.0
|
Public Member Functions | |
void | Present () |
Finishes a frame, and presents it to the user More... | |
void | Resize (unsigned newWidth, unsigned newHeight) |
Resizes the presentation chain More... | |
IDXGI::SwapChain * | GetUnderlying () const |
void | AttachToContext (ID3D::DeviceContext *context, ID3D::Device *device) |
std::shared_ptr< ViewportContext > | GetViewportContext () const |
Returns a context object that will track the size of the viewport More... | |
PresentationChain (intrusive_ptr< IDXGI::SwapChain > underlying, const void *attachedWindow) | |
|
virtual |
Returns a context object that will track the size of the viewport
Implements RenderCore::IPresentationChain.
|
virtual |
Finishes a frame, and presents it to the user
Present() is used to finish a frame, and present it to the user.
The system will often stall in Present(). This is the most likely place we need to synchronise with the hardware. So, if the CPU is running fast and the GPU can't keep up, we'll get a stall in Present(). Normally, this is a good thing, because it means we're GPU bound.
Back buffers get flipped when we Present(). So any new rendering after Present will go to the next frame.
Normally, present is used like this:
But in theory we can call Present at any time.
Implements RenderCore::IPresentationChain.
|
virtual |
Resizes the presentation chain
Resizes the presentation chain. Normally this is called after the output window changes size. If the presentation chain size doesn't match the output window's size, the behaviour is undefined (though on windows, the output is stretched to the window size).
Use the default arguments to automatically adjust to the same size as the window.
Implements RenderCore::IPresentationChain.