Browse Source

gpu: document and tweak some class declarations.

legacy
Sam Hocevar sam 12 years ago
parent
commit
2df85645fb
2 changed files with 11 additions and 5 deletions
  1. +8
    -2
      src/gpu/vertexbuffer.h
  2. +3
    -3
      src/video.h

+ 8
- 2
src/gpu/vertexbuffer.h View File

@@ -36,6 +36,10 @@ private:
class VertexBufferData *m_data; 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 struct VertexUsage
{ {
enum Value enum Value
@@ -57,10 +61,12 @@ struct VertexUsage
} }
m_value; m_value;


inline VertexUsage(Value v) { m_value = v; }
inline VertexUsage(Value v) : m_value(v) {}
inline operator Value() { return m_value; } 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 struct MeshPrimitive
{ {
enum Value enum Value
@@ -70,7 +76,7 @@ struct MeshPrimitive
} }
m_value; m_value;


inline MeshPrimitive(Value v) { m_value = v; }
inline MeshPrimitive(Value v) : m_value(v) {}
inline operator Value() { return m_value; } inline operator Value() { return m_value; }
}; };




+ 3
- 3
src/video.h View File

@@ -27,7 +27,7 @@ struct ClearMask
enum Value enum Value
{ {
/* Note: D3D9 doesn't appear to support the accumulation buffer, /* 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, Color = 1 << 0,
Depth = 1 << 1, Depth = 1 << 1,
Stencil = 1 << 2, Stencil = 1 << 2,
@@ -36,8 +36,8 @@ struct ClearMask
} }
m_value; 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; } inline operator Value() { return m_value; }
}; };




Loading…
Cancel
Save