From 2df85645fb05a83b89dd4093ada16a1601e18d80 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 22 Aug 2012 17:14:02 +0000 Subject: [PATCH] gpu: document and tweak some class declarations. --- src/gpu/vertexbuffer.h | 10 ++++++++-- src/video.h | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gpu/vertexbuffer.h b/src/gpu/vertexbuffer.h index 8055a0b2..c6376fad 100644 --- a/src/gpu/vertexbuffer.h +++ b/src/gpu/vertexbuffer.h @@ -36,6 +36,10 @@ private: class VertexBufferData *m_data; }; +/* A safe enum to indicate how a vertex stream is going to be used. For + * now there is only TexCoord and not TexCoord0 TexCoord1 etc. because + * we can always reorganise the vertex declaration for the indices to + * match. If the need arises these enums will be added. */ struct VertexUsage { enum Value @@ -57,10 +61,12 @@ struct VertexUsage } m_value; - inline VertexUsage(Value v) { m_value = v; } + inline VertexUsage(Value v) : m_value(v) {} inline operator Value() { return m_value; } }; +/* A safe enum to indicate what kind of primitive to draw. Used in + * VertexDeclaration::DrawElements() for instance. */ struct MeshPrimitive { enum Value @@ -70,7 +76,7 @@ struct MeshPrimitive } m_value; - inline MeshPrimitive(Value v) { m_value = v; } + inline MeshPrimitive(Value v) : m_value(v) {} inline operator Value() { return m_value; } }; diff --git a/src/video.h b/src/video.h index 7dcc4f87..05f86483 100644 --- a/src/video.h +++ b/src/video.h @@ -27,7 +27,7 @@ struct ClearMask enum Value { /* Note: D3D9 doesn't appear to support the accumulation buffer, - * and it is a deprecated OpenGL feature. No reasone to support it. */ + * and it is a deprecated OpenGL feature. No reason to support it. */ Color = 1 << 0, Depth = 1 << 1, Stencil = 1 << 2, @@ -36,8 +36,8 @@ struct ClearMask } m_value; - inline ClearMask(Value v) { m_value = v; } - inline ClearMask(uint64_t i) { m_value = (Value)i; } + inline ClearMask(Value v) : m_value(v) {} + inline ClearMask(uint64_t i) : m_value((Value)i) {} inline operator Value() { return m_value; } };