summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2015-11-25 07:53:58 +0100
committerMarkus Wick <degasus@users.noreply.github.com>2015-11-25 07:53:58 +0100
commit662e4fcca061e3fe67a5d529fee5cbceee741797 (patch)
tree1413d32886af8194afd8a97ecf28715ab1d08666 /Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
parentf560e8e283281d6130b2592617f2fe6453cebf83 (diff)
parent0b02dc4f814c4e842f460fd0814b8a7c5379b8c8 (diff)
Merge pull request #3276 from degasus/videocommon
Videocommon API cleanup
Diffstat (limited to 'Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
index 4b2951a689..be29d9fbfe 100644
--- a/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
+++ b/Source/Core/VideoBackends/D3D/NativeVertexFormat.cpp
@@ -20,16 +20,15 @@ class D3DVertexFormat : public NativeVertexFormat
ID3D11InputLayout* m_layout;
public:
- D3DVertexFormat() : m_num_elems(0), m_layout(nullptr) {}
+ D3DVertexFormat(const PortableVertexDeclaration& vtx_decl);
~D3DVertexFormat() { SAFE_RELEASE(m_layout); }
- void Initialize(const PortableVertexDeclaration &_vtx_decl);
void SetupVertexPointers();
};
-NativeVertexFormat* VertexManager::CreateNativeVertexFormat()
+NativeVertexFormat* VertexManager::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
{
- return new D3DVertexFormat();
+ return new D3DVertexFormat(vtx_decl);
}
static const DXGI_FORMAT d3d_format_lookup[5*4*2] =
@@ -57,9 +56,10 @@ DXGI_FORMAT VarToD3D(VarType t, int size, bool integer)
return retval;
}
-void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
+D3DVertexFormat::D3DVertexFormat(const PortableVertexDeclaration& _vtx_decl)
+ : m_num_elems(0), m_layout(nullptr)
{
- vtx_decl = _vtx_decl;
+ this->vtx_decl = _vtx_decl;
memset(m_elems, 0, sizeof(m_elems));
const AttributeFormat* format = &_vtx_decl.position;