3#include "../ISwapChain.h"
4#include "../Base/ResourcePointer.h"
10 struct GraphicsDeviceD3D11;
22 virtual void setSize(
int newWidth,
int newHeight,
bool forceIt =
false)
override;
27 virtual int getWidth()
const override {
return width; }
28 virtual int getHeight()
const override {
return height; }
29 virtual int getSamples()
const override {
return numSamples; }
35 bool recreateOffscreenBuffers();
38 GraphicsDeviceD3D11* graphicsDevice =
nullptr;
39 TextureFormat colorFormat = TextureFormat::R8G8B8A8_UNORM_SRGB;
40 TextureFormat depthFormat = TextureFormat::D32_FLOAT;
45 bool needResize =
false;
46 ResourcePointer<IDXGISwapChain> swapChain;
47 ResourcePointer<ID3D11Texture2D> backBuffer;
48 ResourcePointer<ID3D11Texture2D> sharedBackBuffer;
49 RenderTargetHandle renderTarget;
50 DepthStencilHandle depthStencil;
virtual void beginFrame() override
Signal the beginning of a new frame to the graphics device.
bool createDepthStencilView()
Recreates the depth/stencil view used by directx when rendering.
virtual void endFrame(uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None) override
Signal the end of a frame to the graphics device.
virtual int getSamples() const override
Returns the number of samples this swap chain has.
virtual void setFullscreen(bool enabled) override
Changes this swapchain's fullscreen state if neccessary.
virtual bool isFullscreen() override
Test whether the current swap chain is fullscreen.
virtual int getWidth() const override
Returns the pixel width of this swap chain.
virtual int getHeight() const override
Returns the pixel height of this swap chain.
virtual const DepthStencilHandle & getDepthStencil() const override
Returns the depth stencil managed by this swap chain.
bool createRenderTargetView()
Recreates the render target view used by directx when selecting render targets prior to rendering.
virtual void setSize(int newWidth, int newHeight, bool forceIt=false) override
Set the size of the main drawing buffer used by the graphics device in pixels.
virtual const RenderTargetHandle & getRenderTarget() const override
Returns the render target managed by this swap chain.
Contains all Cogs related functionality.