3#include "Foundation/HashFunctions.h"
6#define STATIC_ASSERT_MAPPING(mappingArray, sourceEnum) static_assert(sizeof(mappingArray) / sizeof(mappingArray[0]) == (int)sourceEnum, "Array size of " #mappingArray " must match number of enumerations in mapping array.");
13 struct NoConversion {};
20 template<
typename Type,
typename Convertible = NoConversion>
64 explicit operator bool()
const {
return handle != 0 &&
handle != -1; }
71 operator Convertible() {
return Convertible(this->
handle); };
83 template<
typename T,
typename U>
86 template<
typename T,
typename U>
95 template<
typename T,
typename U>
96 struct hash<
Cogs::Handle_t<T, U>>
100 return std::hash<typename Cogs::Handle_t<T, U>::handle_type>()(handle.
handle);
202 struct InputLayoutTag {};
204 struct TextureTag {};
205 struct SamplerTag {};
208 struct RenderPipelineTag {};
209 struct ComputePipelineTag {};
210 struct RenderTargetTag {};
211 struct DepthStencilTag {};
212 struct ConstantBufferBindingTag {};
213 struct VariableBindingTag {};
214 struct TextureBindingTag {};
215 struct SamplerStateBindingTag {};
216 struct BufferBindingTag {};
217 struct TextureViewTag {};
218 struct VertexFormatTag {};
219 struct VertexArrayObjectTag {};
266 template<
typename T,
typename U>
@ Unknown
Unknown type of graphics device.
Handle_t< VertexFormatTag > VertexFormatHandle
Definition: Common.h:234
Handle_t< FenceTag > FenceHandle
Definition: Common.h:258
Axis
Axis definitions.
Definition: Common.h:188
Handle_t< ConstantBufferBindingTag > ConstantBufferBindingHandle
Definition: Common.h:251
Handle_t< BufferTag, BufferHandle > IndexBufferHandle
Definition: Common.h:232
Handle_t< struct RasterizerState > RasterizerStateHandle
Definition: Common.h:224
Handle_t< VariableBindingTag > EffectVariableHandle
Definition: Common.h:250
Handle_t< InputLayoutTag > InputLayoutHandle
Definition: Common.h:228
Handle_t< ComputePipelineTag > ComputePipelineHandle
Definition: Common.h:245
Handle_t< DepthStencilTag > DepthStencilHandle
Definition: Common.h:248
Handle_t< ShaderTag > ShaderHandle
Definition: Common.h:243
bool isDebug()
Definition: Common.h:272
Handle_t< SamplerStateBindingTag > SamplerStateBindingHandle
Definition: Common.h:253
Handle_t< SamplerTag > SamplerStateHandle
Definition: Common.h:240
Handle_t< BufferBindingTag > BufferBindingHandle
Definition: Common.h:254
Handle_t< TextureViewTag > TextureViewHandle
Definition: Common.h:256
Handle_t< VertexArrayObjectTag > VertexArrayObjectHandle
Definition: Common.h:236
intptr_t TextureNativeHandle
Definition: Common.h:238
Handle_t< RenderTargetTag > RenderTargetHandle
Definition: Common.h:247
Handle_t< struct BlendState > BlendStateHandle
Definition: Common.h:226
Handle_t< EffectTag > EffectHandle
Definition: Common.h:242
bool HandleIsValid(const Handle_t< T > handle)
Definition: Common.h:261
Handle_t< RenderPipelineTag > RenderPipelineHandle
Definition: Common.h:244
Handle_t< struct DepthStencilState > DepthStencilStateHandle
Definition: Common.h:225
Handle_t< BufferTag, BufferHandle > VertexBufferHandle
Definition: Common.h:231
Handle_t< BufferTag > BufferHandle
Definition: Common.h:230
Handle_t< TextureBindingTag > TextureBindingHandle
Definition: Common.h:252
Handle_t< TextureTag > TextureHandle
Definition: Common.h:239
EBlendFlags
Definition: Common.h:161
@ None
Definition: Common.h:162
@ AlphaToCoverage
Definition: Common.h:163
@ IndependentBlend
Definition: Common.h:164
Framebuffers to select from when doing framebuffer operations.
Definition: Common.h:148
EFrameBuffer
Definition: Common.h:150
@ Back
Back buffer.
Definition: Common.h:154
@ Front
Front buffer.
Definition: Common.h:152
Handle template class used to provide opaque, non-converting handles.
Definition: Common.h:22
static const Handle_t NoHandle
Represents a handle to nothing.
Definition: Common.h:77
Handle_t(const Handle_t &other)
Copy constructor.
Definition: Common.h:34
Handle_t(const handle_type &handle)
Construct a handle with an explicit internal resource handle.
Definition: Common.h:41
Handle_t(const Convertible &other)
Conversion constructor from Convertible type.
Definition: Common.h:48
handle_type handle
Internal resource handle.
Definition: Common.h:74
Handle_t()
Construct a handle.
Definition: Common.h:29
int64_t handle_type
Internal handle storage type.
Definition: Common.h:24
static const Handle_t InvalidHandle
Represents an invalid handle.
Definition: Common.h:80
bool operator==(const Handle_t &other) const
Equality operator.
Definition: Common.h:61
Handle_t & operator=(const Handle_t &other)
Assignment operator.
Definition: Common.h:53
Flags controlling presentation.
Definition: Common.h:172
EPresentFlags
Present flags enumeration.
Definition: Common.h:175
@ NoSwap
Disables frame buffer swapping. This will leave the currently presented buffer as is.
Definition: Common.h:181
@ Default
Default swap flags.
Definition: Common.h:179
@ None
No flags.
Definition: Common.h:177
Primitive types for interpreting vertex data sent to the graphics pipeline.
Definition: Common.h:111
EPrimitiveType
Primitive type enumeration.
Definition: Common.h:114
@ LineStrip
Line strip.
Definition: Common.h:122
@ ControlPoint4PatchList
Definition: Common.h:137
@ ControlPoint2PatchList
Definition: Common.h:135
@ LineStripAdjacency
Line strip with adjacency.
Definition: Common.h:132
@ LineList
List of lines.
Definition: Common.h:120
@ ControlPoint1PatchList
Definition: Common.h:134
@ TriangleStrip
Triangle strip.
Definition: Common.h:118
@ TriangleListAdjacency
List of triangles with adjacency.
Definition: Common.h:126
@ PointList
List of points.
Definition: Common.h:124
@ ControlPoint3PatchList
Definition: Common.h:136
@ TriangleStripAdjacency
Triangle strip with adjacency.
Definition: Common.h:128
@ LineListAdjacency
List of lines with adjacency.
Definition: Common.h:130
@ PrimitiveType_Size
Definition: Common.h:140
@ TriangleList
List of triangles.
Definition: Common.h:116
std::size_t operator()(const Cogs::Handle_t< T, U > &handle) const
Definition: Common.h:98