4#include "Foundation/HashFunctions.h"
7#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.");
14 struct NoConversion {};
21 template<
typename Type,
typename Convertible = NoConversion>
65 explicit operator bool()
const {
return handle != 0 &&
handle != -1; }
72 operator Convertible() {
return Convertible(this->
handle); };
84 template<
typename T,
typename U>
87 template<
typename T,
typename U>
96 template<
typename T,
typename U>
97 struct hash<
Cogs::Handle_t<T, U>>
101 return std::hash<typename Cogs::Handle_t<T, U>::handle_type>()(handle.
handle);
193 struct InputLayoutTag {};
195 struct TextureTag {};
196 struct SamplerTag {};
199 struct RenderPipelineTag {};
200 struct ComputePipelineTag {};
201 struct RenderTargetTag {};
202 struct DepthStencilTag {};
203 struct ConstantBufferBindingTag {};
204 struct VariableBindingTag {};
205 struct TextureBindingTag {};
206 struct SamplerStateBindingTag {};
207 struct BufferBindingTag {};
208 struct TextureViewTag {};
209 struct VertexFormatTag {};
210 struct VertexArrayObjectTag {};
257 template<
typename T,
typename U>
#define COGS_RENDERING_ENABLE_ENUM_FLAGS(EnumType)
Definition: Flags.h:8
@ Default
Default type of graphics device, same as unknown.
@ Unknown
Unknown type of graphics device.
Handle_t< VertexFormatTag > VertexFormatHandle
Definition: Common.h:225
Handle_t< FenceTag > FenceHandle
Definition: Common.h:249
Axis
Axis definitions.
Definition: Common.h:179
Framebuffer
Framebuffers to select from when doing framebuffer operations.
Definition: Common.h:147
Handle_t< ConstantBufferBindingTag > ConstantBufferBindingHandle
Definition: Common.h:242
Handle_t< BufferTag, BufferHandle > IndexBufferHandle
Definition: Common.h:223
Handle_t< struct RasterizerState > RasterizerStateHandle
Definition: Common.h:215
Handle_t< VariableBindingTag > EffectVariableHandle
Definition: Common.h:241
Handle_t< InputLayoutTag > InputLayoutHandle
Definition: Common.h:219
Handle_t< ComputePipelineTag > ComputePipelineHandle
Definition: Common.h:236
Handle_t< DepthStencilTag > DepthStencilHandle
Definition: Common.h:239
PresentFlags
Flags controlling presentation.
Definition: Common.h:166
@ NoSwap
Disables frame buffer swapping. This will leave the currently presented buffer as is.
Handle_t< ShaderTag > ShaderHandle
Definition: Common.h:234
PrimitiveType
Primitive types for interpreting vertex data sent to the graphics pipeline.
Definition: Common.h:112
@ PointList
List of points.
@ TriangleStrip
Triangle strip.
@ TriangleStripAdjacency
Triangle strip with adjacency.
@ LineStripAdjacency
Line strip with adjacency.
@ LineListAdjacency
List of lines with adjacency.
@ TriangleListAdjacency
List of triangles with adjacency.
@ TriangleList
List of triangles.
@ None
Default flags.
Definition: IGraphicsDevice.h:30
bool isDebug()
Definition: Common.h:263
Handle_t< SamplerStateBindingTag > SamplerStateBindingHandle
Definition: Common.h:244
Handle_t< SamplerTag > SamplerStateHandle
Definition: Common.h:231
Handle_t< BufferBindingTag > BufferBindingHandle
Definition: Common.h:245
Handle_t< TextureViewTag > TextureViewHandle
Definition: Common.h:247
Handle_t< VertexArrayObjectTag > VertexArrayObjectHandle
Definition: Common.h:227
intptr_t TextureNativeHandle
Definition: Common.h:229
Handle_t< RenderTargetTag > RenderTargetHandle
Definition: Common.h:238
Handle_t< struct BlendState > BlendStateHandle
Definition: Common.h:217
Handle_t< EffectTag > EffectHandle
Definition: Common.h:233
bool HandleIsValid(const Handle_t< T > handle)
Definition: Common.h:252
Handle_t< RenderPipelineTag > RenderPipelineHandle
Definition: Common.h:235
Handle_t< struct DepthStencilState > DepthStencilStateHandle
Definition: Common.h:216
Handle_t< BufferTag, BufferHandle > VertexBufferHandle
Definition: Common.h:222
Handle_t< BufferTag > BufferHandle
Definition: Common.h:221
BlendFlags
Definition: Common.h:155
Handle_t< TextureBindingTag > TextureBindingHandle
Definition: Common.h:243
Handle_t< TextureTag > TextureHandle
Definition: Common.h:230
Handle template class used to provide opaque, non-converting handles.
Definition: Common.h:23
static const Handle_t NoHandle
Represents a handle to nothing.
Definition: Common.h:78
Handle_t(const Handle_t &other)
Copy constructor.
Definition: Common.h:35
Handle_t(const handle_type &handle)
Construct a handle with an explicit internal resource handle.
Definition: Common.h:42
Handle_t(const Convertible &other)
Conversion constructor from Convertible type.
Definition: Common.h:49
handle_type handle
Internal resource handle.
Definition: Common.h:75
Handle_t()
Construct a handle.
Definition: Common.h:30
int64_t handle_type
Internal handle storage type.
Definition: Common.h:25
static const Handle_t InvalidHandle
Represents an invalid handle.
Definition: Common.h:81
bool operator==(const Handle_t &other) const
Equality operator.
Definition: Common.h:62
Handle_t & operator=(const Handle_t &other)
Assignment operator.
Definition: Common.h:54
std::size_t operator()(const Cogs::Handle_t< T, U > &handle) const
Definition: Common.h:99