Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
|
#include <color_buffer.h>
Public Member Functions | |
ColorBuffer () | |
ColorBuffer (float clear_color[4]) | |
void | CreateFromSwapChain (const WString &name, ID3D12Resource *swap_chain_resource, float clear_color[4]) |
void | Create (const WString &name, UINT width, UINT height, DXGI_FORMAT format) |
const UINT & | GetSRV () const |
const UINT & | GetRTV () const |
const UINT & | GetUAV () const |
const float * | GetClearColor () const |
const D3D12_CLEAR_VALUE & | GetClearValue () const |
Public Member Functions inherited from blowbox::PixelBuffer | |
PixelBuffer () | |
const UINT & | GetWidth () const |
const UINT & | GetHeight () const |
const DXGI_FORMAT & | GetFormat () const |
Public Member Functions inherited from blowbox::GpuResource | |
GpuResource () | |
GpuResource (ID3D12Resource *resource, D3D12_RESOURCE_STATES current_state) | |
virtual | ~GpuResource () |
void | Associate (ID3D12Resource *resource, D3D12_RESOURCE_STATES current_state) |
void | Destroy () |
ID3D12Resource * | operator-> () |
const ID3D12Resource * | operator-> () const |
operator ID3D12Resource * () | |
ID3D12Resource * | Get () |
const D3D12_RESOURCE_STATES & | GetState () const |
const D3D12_RESOURCE_STATES & | GetTransitionState () const |
Protected Member Functions | |
void | CreateDerivedViews (DXGI_FORMAT format) |
Protected Member Functions inherited from blowbox::PixelBuffer | |
D3D12_RESOURCE_DESC | DescribeTex2D (UINT width, UINT height, UINT depth_or_array_size, UINT num_mips, DXGI_FORMAT format, UINT flags) |
void | AssociateWithResource (const WString &name, ID3D12Resource *resource, const D3D12_RESOURCE_STATES ¤t_resource_state) |
void | CreateTextureResource (const WString &name, const D3D12_RESOURCE_DESC &resource_desc, const D3D12_CLEAR_VALUE &clear_value) |
Protected Member Functions inherited from blowbox::GpuResource | |
void | AddToMemoryProfiler () |
void | RemoveFromMemoryProfiler () |
Private Attributes | |
UINT | srv_id_ |
UINT | rtv_id_ |
UINT | uav_id_ |
float | clear_color_ [4] |
D3D12_CLEAR_VALUE | clear_value_ |
Additional Inherited Members | |
Static Protected Member Functions inherited from blowbox::PixelBuffer | |
static DXGI_FORMAT | GetBaseFormat (DXGI_FORMAT format) |
static DXGI_FORMAT | GetUAVFormat (DXGI_FORMAT format) |
static DXGI_FORMAT | GetDSVFormat (DXGI_FORMAT format) |
static DXGI_FORMAT | GetDepthFormat (DXGI_FORMAT format) |
static DXGI_FORMAT | GetStencilFormat (DXGI_FORMAT format) |
Protected Attributes inherited from blowbox::PixelBuffer | |
UINT | width_ |
UINT | height_ |
UINT | array_size_ |
DXGI_FORMAT | format_ |
Protected Attributes inherited from blowbox::GpuResource | |
WString | name_ |
ID3D12Resource * | resource_ |
D3D12_RESOURCE_STATES | usage_state_ |
D3D12_RESOURCE_STATES | transition_state_ |
D3D12_GPU_VIRTUAL_ADDRESS | gpu_virtual_address_ |
Buffer-type for buffers with color data in them.
This buffer types allows you to store color data in a buffer. A ColorBuffer is useful for standard textures such as diffuse, specular, normal, etc maps.
blowbox::ColorBuffer::ColorBuffer | ( | ) |
Constructs a ColorBuffer.
blowbox::ColorBuffer::ColorBuffer | ( | float | clear_color[4] | ) |
Constructs a ColorBuffer with an optimized clear value.
[in] | clear_color | The clear color that should be used for this buffer when clearing it. |
void blowbox::ColorBuffer::Create | ( | const WString & | name, |
UINT | width, | ||
UINT | height, | ||
DXGI_FORMAT | format | ||
) |
Creates a new ColorBuffer.
[in] | name | The name for the ColorBuffer. |
[in] | width | The width of the ColorBuffer in texels. |
[in] | height | The height of the ColorBuffer in texels. |
[in] | format | The per-texel data format. |
|
protected |
Creates all the descriptors (views) for this ColorBuffer.
[in] | format | The format of the base resource. |
void blowbox::ColorBuffer::CreateFromSwapChain | ( | const WString & | name, |
ID3D12Resource * | swap_chain_resource, | ||
float | clear_color[4] | ||
) |
Creates a ColorBuffer from a SwapChain buffer.
[in] | name | The name for the ColorBuffer. |
[in] | swap_chain_resource | The resource you got from the SwapChain. |
[in] | clear_color | The clear color that should be used for this buffer when clearing it. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
The clear color for this ColorBuffer.
|
private |
The clear value for this ColorBuffer.
|
private |
The RTV for this ColorBuffer.
|
private |
The SRV for this ColorBuffer.
|
private |
The UAV for this ColorBuffer.