Skip to content

Commit 426cafc

Browse files
committed
Return UINT instead of size_t
1 parent 8905fa8 commit 426cafc

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ ShaderCollection ShaderCollection::CreateShaderCollection(const ShaderCollection
4646
return collection;
4747
}
4848

49-
size_t ShaderCollection::GetLayoutByteSize(VertexType vertexType)
49+
UINT ShaderCollection::GetLayoutByteSize(VertexType vertexType)
5050
{
5151
switch (vertexType)
5252
{
5353
case VertexType::PositionColor:
54-
return sizeof(VertexPositionColor);
54+
return static_cast<UINT>(sizeof(VertexPositionColor));
5555
}
5656
return 0;
5757
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ShaderCollection
2020

2121
static ShaderCollection CreateShaderCollection(
2222
const ShaderCollectionDescriptor& settings, ID3D11Device* device);
23-
static size_t GetLayoutByteSize(VertexType vertexType);
23+
static UINT GetLayoutByteSize(VertexType vertexType);
2424

2525
void ApplyToContext(ID3D11DeviceContext* context);
2626
void Destroy();

src/Cpp/1-getting-started/1-3-2-Texturing/ShaderCollection.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ ShaderCollection ShaderCollection::CreateShaderCollection(const ShaderCollection
8080
return collection;
8181
}
8282

83-
size_t ShaderCollection::GetLayoutByteSize(VertexType vertexType)
83+
UINT ShaderCollection::GetLayoutByteSize(VertexType vertexType)
8484
{
8585
switch (vertexType)
8686
{
8787
case VertexType::PositionColor:
88-
return sizeof(VertexPositionColor);
88+
return static_cast<UINT>(sizeof(VertexPositionColor));
8989
case VertexType::PositionColorUv:
90-
return sizeof(VertexPositionColorUv);
90+
return static_cast<UINT>(sizeof(VertexPositionColorUv));
9191
}
9292
return 0;
9393
}

src/Cpp/1-getting-started/1-3-2-Texturing/ShaderCollection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ShaderCollection
2020

2121
static ShaderCollection CreateShaderCollection(
2222
const ShaderCollectionDescriptor& settings, ID3D11Device* device);
23-
static size_t GetLayoutByteSize(VertexType vertexType);
23+
static UINT GetLayoutByteSize(VertexType vertexType);
2424

2525
void ApplyToContext(ID3D11DeviceContext* context);
2626
void Destroy();

src/Cpp/1-getting-started/1-3-3-SettingUp3DRendering/ShaderCollection.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ ShaderCollection ShaderCollection::CreateShaderCollection(const ShaderCollection
8080
return collection;
8181
}
8282

83-
size_t ShaderCollection::GetLayoutByteSize(VertexType vertexType)
83+
UINT ShaderCollection::GetLayoutByteSize(VertexType vertexType)
8484
{
8585
switch (vertexType)
8686
{
8787
case VertexType::PositionColor:
88-
return sizeof(VertexPositionColor);
88+
return static_cast<UINT>(sizeof(VertexPositionColor));
8989
case VertexType::PositionColorUv:
90-
return sizeof(VertexPositionColorUv);
90+
return static_cast<UINT>(sizeof(VertexPositionColorUv));
9191
}
9292
return 0;
9393
}

src/Cpp/1-getting-started/1-3-3-SettingUp3DRendering/ShaderCollection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ShaderCollection
2121
static ShaderCollection CreateShaderCollection(
2222
const ShaderCollectionDescriptor& settings, ID3D11Device* device);
2323

24-
static size_t GetLayoutByteSize(VertexType vertexType);
24+
static UINT GetLayoutByteSize(VertexType vertexType);
2525

2626
void ApplyToContext(ID3D11DeviceContext* context);
2727
void Destroy();

src/Cpp/1-getting-started/1-3-4-3DRendering/ShaderCollection.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ ShaderCollection ShaderCollection::CreateShaderCollection(const ShaderCollection
8080
return collection;
8181
}
8282

83-
size_t ShaderCollection::GetLayoutByteSize(VertexType vertexType)
83+
UINT ShaderCollection::GetLayoutByteSize(VertexType vertexType)
8484
{
8585
switch (vertexType)
8686
{
8787
case VertexType::PositionColor:
88-
return sizeof(VertexPositionColor);
88+
return static_cast<UINT>(sizeof(VertexPositionColor));
8989
case VertexType::PositionColorUv:
90-
return sizeof(VertexPositionColorUv);
90+
return static_cast<UINT>(sizeof(VertexPositionColorUv));
9191
}
9292
return 0;
9393
}

src/Cpp/1-getting-started/1-3-4-3DRendering/ShaderCollection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ShaderCollection
2020

2121
static ShaderCollection CreateShaderCollection(
2222
const ShaderCollectionDescriptor& settings, ID3D11Device* device);
23-
static size_t GetLayoutByteSize(VertexType vertexType);
23+
static UINT GetLayoutByteSize(VertexType vertexType);
2424

2525
void ApplyToContext(ID3D11DeviceContext* context);
2626
void Destroy();

0 commit comments

Comments
 (0)