Skip to content

Commit 29801c2

Browse files
committed
Make GetLayoutByteSize part of PipelineFactory
1 parent 5dc7a42 commit 29801c2

34 files changed

+65
-18
lines changed

src/Cpp/1-getting-started/1-1-3-HelloTriangle-Refactored/DeviceContext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
DeviceContext::DeviceContext(WRL::ComPtr<ID3D11DeviceContext>&& deviceContext)
77
{
88
_deviceContext = std::move(deviceContext);
9+
_activePipeline = nullptr;
10+
_drawVertices = 0;
911
}
1012

1113
void DeviceContext::Clear(

src/Cpp/1-getting-started/1-1-3-HelloTriangle-Refactored/PipelineFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <iostream>
77

8-
static size_t GetLayoutByteSize(VertexType vertexType)
8+
size_t PipelineFactory::GetLayoutByteSize(const VertexType vertexType)
99
{
1010
switch (vertexType)
1111
{

src/Cpp/1-getting-started/1-1-3-HelloTriangle-Refactored/PipelineFactory.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class PipelineFactory
2727
std::unique_ptr<Pipeline>& pipeline);
2828

2929
private:
30+
static size_t GetLayoutByteSize(VertexType vertexType);
31+
3032
[[nodiscard]] WRL::ComPtr<ID3D11VertexShader> CreateVertexShader(
3133
const std::wstring& filePath,
3234
WRL::ComPtr<ID3DBlob>& vertexShaderBlob) const;

src/Cpp/1-getting-started/1-2-2-DebugLayer/DeviceContext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
DeviceContext::DeviceContext(WRL::ComPtr<ID3D11DeviceContext>&& deviceContext)
77
{
88
_deviceContext = std::move(deviceContext);
9+
_activePipeline = nullptr;
10+
_drawVertices = 0;
911
}
1012

1113
void DeviceContext::Clear(

src/Cpp/1-getting-started/1-2-2-DebugLayer/PipelineFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <iostream>
77

8-
static size_t GetLayoutByteSize(VertexType vertexType)
8+
size_t PipelineFactory::GetLayoutByteSize(const VertexType vertexType)
99
{
1010
switch (vertexType)
1111
{

src/Cpp/1-getting-started/1-2-2-DebugLayer/PipelineFactory.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class PipelineFactory
2727
std::unique_ptr<Pipeline>& pipeline);
2828

2929
private:
30+
static size_t GetLayoutByteSize(VertexType vertexType);
31+
3032
[[nodiscard]] WRL::ComPtr<ID3D11VertexShader> CreateVertexShader(
3133
const std::wstring& filePath,
3234
WRL::ComPtr<ID3DBlob>& vertexShaderBlob) const;

src/Cpp/1-getting-started/1-2-3-NamingThings/DeviceContext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
DeviceContext::DeviceContext(WRL::ComPtr<ID3D11DeviceContext>&& deviceContext)
77
{
88
_deviceContext = std::move(deviceContext);
9+
_activePipeline = nullptr;
10+
_drawVertices = 0;
911
}
1012

1113
void DeviceContext::Clear(

src/Cpp/1-getting-started/1-2-3-NamingThings/PipelineFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <iostream>
77

8-
static size_t GetLayoutByteSize(VertexType vertexType)
8+
size_t PipelineFactory::GetLayoutByteSize(const VertexType vertexType)
99
{
1010
switch (vertexType)
1111
{

src/Cpp/1-getting-started/1-2-3-NamingThings/PipelineFactory.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class PipelineFactory
2727
std::unique_ptr<Pipeline>& pipeline);
2828

2929
private:
30+
static size_t GetLayoutByteSize(VertexType vertexType);
31+
3032
[[nodiscard]] WRL::ComPtr<ID3D11VertexShader> CreateVertexShader(
3133
const std::wstring& filePath,
3234
WRL::ComPtr<ID3DBlob>& vertexShaderBlob) const;

src/Cpp/1-getting-started/1-3-1-ImageLibrary/DeviceContext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
DeviceContext::DeviceContext(WRL::ComPtr<ID3D11DeviceContext>&& deviceContext)
77
{
88
_deviceContext = std::move(deviceContext);
9+
_activePipeline = nullptr;
10+
_drawVertices = 0;
911
}
1012

1113
void DeviceContext::Clear(

0 commit comments

Comments
 (0)