3 #include "util/assert.h" 4 #include "renderer/buffers/color_buffer.h" 6 #define SWAP_CHAIN_MAX_BUFFER_COUNT 4 37 void Create(HWND output_window, UINT width, UINT height, DXGI_FORMAT format, UINT buffer_count, DXGI_SWAP_EFFECT swap_effect, UINT flags,
bool disable_alt_enter =
true,
bool windowed =
true);
43 void Present(
bool vsync =
true);
95 DXGI_SWAP_CHAIN_DESC
DescribeSwapChain(HWND output_window, UINT width, UINT height, DXGI_FORMAT format, UINT buffer_count, DXGI_SWAP_EFFECT swap_effect, UINT flags,
bool windowed =
true);
ColorBuffer & GetBuffer(UINT buffer_index)
Retrieve a certain buffer from the SwapChain buffers.
Definition: swap_chain.h:50
DXGI_SWAP_CHAIN_DESC DescribeSwapChain(HWND output_window, UINT width, UINT height, DXGI_FORMAT format, UINT buffer_count, DXGI_SWAP_EFFECT swap_effect, UINT flags, bool windowed=true)
Creates a DXGI_SWAP_CHAIN_DESC based on input params.
Definition: swap_chain.cc:64
Buffer-type for buffers with color data in them.
Definition: color_buffer.h:14
const UINT & GetBackBufferIndex() const
Definition: swap_chain.h:69
Wraps the IDXGISwapChain.
Definition: swap_chain.h:19
IDXGISwapChain * operator->()
Overloads the pointer operator to return the underlying IDXGISwapChain.
Definition: swap_chain.h:80
ColorBuffer & GetBackBuffer()
Definition: swap_chain.h:61
const UINT & GetBufferHeight() const
Definition: swap_chain.h:74
void Create(HWND output_window, UINT width, UINT height, DXGI_FORMAT format, UINT buffer_count, DXGI_SWAP_EFFECT swap_effect, UINT flags, bool disable_alt_enter=true, bool windowed=true)
Creates the actual SwapChain.
Definition: swap_chain.cc:26
void Present(bool vsync=true)
Presents the back buffer to the screen.
Definition: swap_chain.cc:57
const ColorBuffer & GetBuffer(UINT buffer_index) const
Retrieve a certain buffer from the SwapChain buffers.
Definition: swap_chain.h:57
const UINT & GetBufferCount() const
Definition: swap_chain.h:67
IDXGISwapChain * swap_chain_
The underlying IDXGISwapChain.
Definition: swap_chain.h:98
The main Blowbox namespace.
Definition: image.cc:8
UINT back_buffer_index_
The current back buffer index.
Definition: swap_chain.h:100
UINT buffer_count_
The number of buffers in use by the SwapChain.
Definition: swap_chain.h:101
const IDXGISwapChain * operator->() const
Overloads the pointer operator to return the underlying IDXGISwapChain.
Definition: swap_chain.h:82
DXGI_SWAP_CHAIN_DESC desc_
The description of the IDXGISwapChain.
Definition: swap_chain.h:99
const UINT & GetBufferWidth() const
Definition: swap_chain.h:72
const ColorBuffer & GetBackBuffer() const
Definition: swap_chain.h:64
ColorBuffer buffers_[SWAP_CHAIN_MAX_BUFFER_COUNT]
All the different SwapChain buffers.
Definition: swap_chain.h:102