diff options
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
| -rw-r--r-- | Graphics/GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h b/Graphics/GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h index e5d328e3..047bf37c 100644 --- a/Graphics/GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h +++ b/Graphics/GraphicsEngineD3DBase/include/D3DTypeConversionImpl.h @@ -23,6 +23,8 @@ #pragma once +#include <array> + /// \file /// Implementation of D3D type conversions @@ -70,7 +72,7 @@ namespace Diligent D3D_PRIM_TOPOLOGY TopologyToD3DTopology(PRIMITIVE_TOPOLOGY Topology) { static bool bIsInit = false; - static D3D_PRIM_TOPOLOGY d3dPrimTopology[PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES] = {}; + static std::array<D3D_PRIM_TOPOLOGY, PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES> d3dPrimTopology = {}; if( !bIsInit ) { d3dPrimTopology[PRIMITIVE_TOPOLOGY_UNDEFINED] = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED; @@ -126,7 +128,7 @@ namespace Diligent { // D3D12_FILL_MODE is identical tp D3D11_FILL_MODE static bool bIsInit = false; - static D3D_FILL_MODE d3dFillModes[FILL_MODE_NUM_MODES] = {}; + static std::array<D3D_FILL_MODE, FILL_MODE_NUM_MODES> d3dFillModes = {}; if( !bIsInit ) { d3dFillModes[ FILL_MODE_WIREFRAME ] = D3D_FILL_MODE_WIREFRAME; @@ -152,7 +154,7 @@ namespace Diligent { // D3D_CULL_MODE is identical to D3D11_CULL_MODE static bool bIsInit = false; - static D3D_CULL_MODE d3dCullModes[CULL_MODE_NUM_MODES] = {}; + static std::array<D3D_CULL_MODE, CULL_MODE_NUM_MODES> d3dCullModes = {}; if( !bIsInit ) { d3dCullModes[ CULL_MODE_NONE ] = D3D_CULL_MODE_NONE; @@ -204,7 +206,7 @@ namespace Diligent // Note that this code is safe for multithreaded environments since // bIsInit is set to true only AFTER the entire map is initialized. static bool bIsInit = false; - static D3D_BLEND D3DBlend[BLEND_FACTOR_NUM_FACTORS] = {}; + static std::array<D3D_BLEND, BLEND_FACTOR_NUM_FACTORS> D3DBlend = {}; if( !bIsInit ) { // In a multithreaded environment, several threads can potentially enter @@ -249,7 +251,7 @@ namespace Diligent // D3D12_BLEND_OP and D3D11_BLEND_OP are identical static bool bIsInit = false; - static D3D_BLEND_OP D3DBlendOp[BLEND_OPERATION_NUM_OPERATIONS] = {}; + static std::array<D3D_BLEND_OP, BLEND_OPERATION_NUM_OPERATIONS> D3DBlendOp = {}; if( !bIsInit ) { D3DBlendOp[ BLEND_OPERATION_ADD ] = D3D_BLEND_OP_ADD; @@ -311,7 +313,7 @@ namespace Diligent D3D_STENCIL_OP StencilOpToD3DStencilOp( STENCIL_OP StencilOp ) { static bool bIsInit = false; - static D3D_STENCIL_OP StOpToD3DStOpMap[STENCIL_OP_NUM_OPS] = {}; + static std::array<D3D_STENCIL_OP, STENCIL_OP_NUM_OPS> StOpToD3DStOpMap = {}; if( !bIsInit ) { StOpToD3DStOpMap[ STENCIL_OP_KEEP ] = D3D_STENCIL_OP_KEEP; |
