Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // .h
- //
- // vertex buffer list
- // order: EnumId, Format, Name
- #define VB_LIST(V) \
- V(Position, DXGI_FORMAT_R32G32B32_FLOAT, "POSITION") \
- V(Normal, DXGI_FORMAT_R32G32B32_FLOAT, "NORMAL") \
- V(TexCoords, DXGI_FORMAT_R32G32_FLOAT, "TEXCOORD")
- struct VertexBufferId
- {
- enum Type
- {
- #define VB_ITEM(EnumId, Format, Name) EnumId,
- VB_LIST(VB_ITEM)
- #undef VB_ITEM
- Count
- };
- };
- DXGI_FORMAT vbFormats[VertexBufferId::Count + 1];
- const char* vbNames[VertexBufferId::Count + 1];
- //
- // .cpp
- //
- // the +1 is to account for the macro expansion of the comma character
- // some old compilers will complain about it
- DXGI_FORMAT vbFormats[VertexBufferId::Count + 1] =
- {
- #define VB_ITEM(EnumId, Format, Name) Format,
- VB_LIST(VB_ITEM)
- #undef VB_ITEM
- DXGI_FORMAT_UNKNOWN
- };
- const char* vbNames[VertexBufferId::Count + 1] =
- {
- #define VB_ITEM(EnumId, Format, Name) Name,
- VB_LIST(VB_ITEM)
- #undef VB_ITEM
- ""
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement