154
edits
Changes
→Week 5 - Feb 6
* Vertex Declarations
*: [http://msdn.microsoft.com/en-us/library/windows/desktop/bb172559%28v=vs.85%29.aspx FVF Codes]
<syntaxhighlight lang="cpp">
template <class T = Vertex>
class APIVertexDeclaration {
static D3DVERTEXELEMENT9 fmt[MAXD3DDECLLENGTH + 1];
static unsigned vertexSize;
public:
static D3DVERTEXELEMENT9* format() { return fmt; }
static unsigned size() { return vertexSize; }
};
</syntaxhighlight>
<syntaxhighlight lang="cpp">
template <>
template<>
unsigned APIVertexDeclaration<Vertex>::vertexSize = 32;
</syntaxhighlight>
<syntaxhighlight lang="cpp">
template <>
unsigned APIVertexDeclaration<LitVertex>::vertexSize = 16;
</syntaxhighlight>
* The Pipeline
*: [http://en.wikipedia.org/wiki/Instruction_pipeline What is a pipeline]