XLE
v0.02.0
|
Represents a set of back buffer for rendering to a window More...
#include <IDevice.h>
Public Member Functions | |
virtual void | Present ()=0 |
Finishes a frame, and presents it to the user More... | |
virtual void | Resize (unsigned newWidth=0, unsigned newHeight=0)=0 |
Resizes the presentation chain More... | |
virtual std::shared_ptr< ViewportContext > | GetViewportContext () const =0 |
Returns a context object that will track the size of the viewport More... | |
Represents a set of back buffer for rendering to a window
For most platforms we require 1 or more back buffers, and some output window to render on. This is want the presentation chain is for.
Normally there is only one RenderCore::Device, but sometimes we need multiple PresentationChains (for example, if we want to render to multiple windows, in an editor.
PresentationChain closely matches IDXGISwapChain behaviour in windows.
Call RenderCore::IDevice::CreatePresentationChain to create a new chain.
|
pure virtual |
Returns a context object that will track the size of the viewport
Implemented in RenderCore::PresentationChain.
|
pure 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.
Implemented in RenderCore::PresentationChain.
|
pure 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.
Implemented in RenderCore::PresentationChain.