Skip to content

Commit f07aa98

Browse files
committed
Remove superfluous const keyword from function declarations. Fixes #107
1 parent 3fc50c0 commit f07aa98

File tree

64 files changed

+154
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+154
-155
lines changed

src/Cpp/1-getting-started/1-1-2-HelloD3D11/HelloD3D11Application.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class HelloD3D11Application final : public Application
1818
bool Initialize() override;
1919
bool Load() override;
2020
void OnResize(
21-
const int32_t width,
22-
const int32_t height) override;
21+
int32_t width,
22+
int32_t height) override;
2323
void Update() override;
2424
void Render() override;
2525

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DeviceContext::DeviceContext(WRL::ComPtr<ID3D11DeviceContext>&& deviceContext)
1010

1111
void DeviceContext::Clear(
1212
ID3D11RenderTargetView* renderTarget,
13-
const float clearColor[4]) const
13+
float clearColor[4]) const
1414
{
1515
_deviceContext->ClearRenderTargetView(renderTarget, clearColor);
1616
_deviceContext->OMSetRenderTargets(1, &renderTarget, nullptr);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class DeviceContext
1515

1616
void Clear(
1717
ID3D11RenderTargetView* renderTarget,
18-
const float clearColor[4]) const;
18+
float clearColor[4]) const;
1919
void SetPipeline(const Pipeline* pipeline);
2020
void SetVertexBuffer(
2121
ID3D11Buffer* triangleVertices,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void HelloTriangleApplication::Update()
211211

212212
void HelloTriangleApplication::Render()
213213
{
214-
constexpr float clearColor[] = { 0.1f, 0.1f, 0.1f, 1.0f };
214+
float clearColor[] = { 0.1f, 0.1f, 0.1f, 1.0f };
215215
constexpr uint32_t vertexOffset = 0;
216216

217217
_deviceContext->Clear(_renderTarget.Get(), clearColor);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class HelloTriangleApplication final : public Application
2121
bool Initialize() override;
2222
bool Load() override;
2323
void OnResize(
24-
const int32_t width,
25-
const int32_t height) override;
24+
int32_t width,
25+
int32_t height) override;
2626
void Update() override;
2727
void Render() override;
2828

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ class Pipeline
1313
friend class DeviceContext;
1414

1515
void SetViewport(
16-
const float left,
17-
const float top,
18-
const float width,
19-
const float height);
16+
float left,
17+
float top,
18+
float width,
19+
float height);
2020

2121
private:
2222
WRL::ComPtr<ID3D11VertexShader> _vertexShader = nullptr;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PipelineFactory
3333
[[nodiscard]] WRL::ComPtr<ID3D11PixelShader> CreatePixelShader(const std::wstring& filePath) const;
3434

3535
bool CreateInputLayout(
36-
const VertexType layoutInfo,
36+
VertexType layoutInfo,
3737
const WRL::ComPtr<ID3DBlob>& vertexBlob,
3838
WRL::ComPtr<ID3D11InputLayout>& inputLayout);
3939

src/Cpp/1-getting-started/1-1-3-HelloTriangle/HelloTriangleApplication.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ bool HelloTriangleApplication::Load()
184184

185185

186186
bool HelloTriangleApplication::CompileShader(
187-
const std::wstring_view fileName,
188-
const std::string_view entryPoint,
189-
const std::string_view profile,
187+
const std::wstring& fileName,
188+
const std::string& entryPoint,
189+
const std::string& profile,
190190
ComPtr<ID3DBlob>& shaderBlob) const
191191
{
192192
constexpr uint32_t compileFlags = D3DCOMPILE_ENABLE_STRICTNESS;
@@ -218,7 +218,7 @@ bool HelloTriangleApplication::CompileShader(
218218
}
219219

220220
HelloTriangleApplication::ComPtr<ID3D11VertexShader> HelloTriangleApplication::CreateVertexShader(
221-
const std::wstring_view fileName,
221+
const std::wstring& fileName,
222222
ComPtr<ID3DBlob>& vertexShaderBlob) const
223223
{
224224
if (!CompileShader(fileName, "Main", "vs_5_0", vertexShaderBlob))
@@ -240,7 +240,7 @@ HelloTriangleApplication::ComPtr<ID3D11VertexShader> HelloTriangleApplication::C
240240
return vertexShader;
241241
}
242242

243-
HelloTriangleApplication::ComPtr<ID3D11PixelShader> HelloTriangleApplication::CreatePixelShader(const std::wstring_view fileName) const
243+
HelloTriangleApplication::ComPtr<ID3D11PixelShader> HelloTriangleApplication::CreatePixelShader(const std::wstring& fileName) const
244244
{
245245
ComPtr<ID3DBlob> pixelShaderBlob = nullptr;
246246
if (!CompileShader(fileName, "Main", "ps_5_0", pixelShaderBlob))

src/Cpp/1-getting-started/1-1-3-HelloTriangle/HelloTriangleApplication.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class HelloTriangleApplication final : public Application
1818
bool Initialize() override;
1919
bool Load() override;
2020
void OnResize(
21-
const int32_t width,
22-
const int32_t height) override;
21+
int32_t width,
22+
int32_t height) override;
2323
void Update() override;
2424
void Render() override;
2525

@@ -28,14 +28,14 @@ class HelloTriangleApplication final : public Application
2828
void DestroySwapchainResources();
2929

3030
bool CompileShader(
31-
const std::wstring_view fileName,
32-
const std::string_view entryPoint,
33-
const std::string_view profile,
31+
const std::wstring& fileName,
32+
const std::string& entryPoint,
33+
const std::string& profile,
3434
ComPtr<ID3DBlob>& shaderBlob) const;
3535
[[nodiscard]] ComPtr<ID3D11VertexShader> CreateVertexShader(
36-
const std::wstring_view fileName,
36+
const std::wstring& fileName,
3737
ComPtr<ID3DBlob>& vertexShaderBlob) const;
38-
[[nodiscard]] ComPtr<ID3D11PixelShader> CreatePixelShader(std::wstring_view fileName) const;
38+
[[nodiscard]] ComPtr<ID3D11PixelShader> CreatePixelShader(const std::wstring& fileName) const;
3939

4040
ComPtr<ID3D11Device> _device = nullptr;
4141
ComPtr<ID3D11DeviceContext> _deviceContext = nullptr;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void DebugLayerApplication::Update()
223223

224224
void DebugLayerApplication::Render()
225225
{
226-
constexpr float clearColor[] = { 0.1f, 0.1f, 0.1f, 1.0f };
226+
float clearColor[] = { 0.1f, 0.1f, 0.1f, 1.0f };
227227
constexpr uint32_t vertexOffset = 0;
228228

229229
_deviceContext->Clear(_renderTarget.Get(), clearColor);

0 commit comments

Comments
 (0)