Skip to content

Commit fe94133

Browse files
committed
Streamline wording in error messages. Fixes #103
1 parent c223248 commit fe94133

File tree

26 files changed

+166
-162
lines changed

26 files changed

+166
-162
lines changed

src/Cpp/1-getting-started/1-1-1-HelloGLFWWindow/Main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ int main(int argc, char* argv[])
66
{
77
if (!glfwInit())
88
{
9-
std::cout << "GLFW: Unable to initialize\n";
9+
std::cout << "GLFW: Failed to initialize\n";
1010
return -1;
1111
}
1212

@@ -25,7 +25,7 @@ int main(int argc, char* argv[])
2525
nullptr);
2626
if (window == nullptr)
2727
{
28-
std::cout << "GLFW: Unable to create window\n";
28+
std::cout << "GLFW: Failed to create window\n";
2929
glfwTerminate();
3030
return -1;
3131
}

src/Cpp/1-getting-started/1-1-2-HelloD3D11-Raw/Main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ int main()
102102

103103
if (window == nullptr)
104104
{
105-
std::cout << "GLFW: Unable to create window\n";
105+
std::cout << "GLFW: Failed to create window\n";
106106
glfwTerminate();
107107
return false;
108108
}
@@ -116,7 +116,7 @@ int main()
116116
// This section initializes DirectX's devices and SwapChain
117117
if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&g_DxgiFactory))))
118118
{
119-
std::cout << "DXGI: Unable to create DXGIFactory\n";
119+
std::cout << "DXGI: Failed to create factory\n";
120120
return false;
121121
}
122122

@@ -134,7 +134,7 @@ int main()
134134
nullptr,
135135
&g_DeviceContext)))
136136
{
137-
std::cout << "D3D11: Failed to create Device and Device Context\n";
137+
std::cout << "D3D11: Failed to create device and device context\n";
138138
return false;
139139
}
140140

@@ -161,7 +161,7 @@ int main()
161161
nullptr,
162162
&g_SwapChain)))
163163
{
164-
std::cout << "DXGI: Failed to create SwapChain\n";
164+
std::cout << "DXGI: Failed to create swapchain\n";
165165
return false;
166166
}
167167

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ bool HelloD3D11Application::Initialize()
4141
// This section initializes DirectX's devices and SwapChain
4242
if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&_dxgiFactory))))
4343
{
44-
std::cout << "DXGI: Unable to create DXGIFactory\n";
44+
std::cout << "DXGI: Failed to create factory\n";
4545
return false;
4646
}
4747

@@ -59,7 +59,7 @@ bool HelloD3D11Application::Initialize()
5959
nullptr,
6060
&_deviceContext)))
6161
{
62-
std::cout << "D3D11: Failed to create Device and Device Context\n";
62+
std::cout << "D3D11: Failed to create device and device Context\n";
6363
return false;
6464
}
6565

@@ -86,7 +86,7 @@ bool HelloD3D11Application::Initialize()
8686
nullptr,
8787
&_swapChain)))
8888
{
89-
std::cout << "DXGI: Failed to create SwapChain\n";
89+
std::cout << "DXGI: Failed to create swapchain\n";
9090
return false;
9191
}
9292

@@ -111,7 +111,7 @@ bool HelloD3D11Application::CreateSwapchainResources()
111111
0,
112112
IID_PPV_ARGS(&backBuffer))))
113113
{
114-
std::cout << "D3D11: Failed to get Back Buffer from the SwapChain\n";
114+
std::cout << "D3D11: Failed to get back buffer from the swapchain\n";
115115
return false;
116116
}
117117

@@ -120,7 +120,7 @@ bool HelloD3D11Application::CreateSwapchainResources()
120120
nullptr,
121121
&_renderTarget)))
122122
{
123-
std::cout << "D3D11: Failed to create RTV from Back Buffer\n";
123+
std::cout << "D3D11: Failed to create rendertarget view from back buffer\n";
124124
return false;
125125
}
126126

@@ -148,7 +148,7 @@ void HelloD3D11Application::OnResize(
148148
DXGI_FORMAT::DXGI_FORMAT_B8G8R8A8_UNORM,
149149
0)))
150150
{
151-
std::cout << "D3D11: Failed to recreate SwapChain buffers\n";
151+
std::cout << "D3D11: Failed to recreate swapchain buffers\n";
152152
return;
153153
}
154154

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bool HelloTriangleApplication::Initialize()
5050
// This section initializes DirectX's devices and SwapChain
5151
if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&_dxgiFactory))))
5252
{
53-
std::cout << "DXGI: Unable to create DXGIFactory\n";
53+
std::cout << "DXGI: Failed to create factory\n";
5454
return false;
5555
}
5656

@@ -117,7 +117,7 @@ bool HelloTriangleApplication::Load()
117117
pipelineDescriptor.VertexType = VertexType::PositionColor;
118118
if (!_pipelineFactory->CreatePipeline(pipelineDescriptor, _pipeline))
119119
{
120-
std::cout << "PipelineFactory: Unable to create pipeline\n";
120+
std::cout << "PipelineFactory: Failed to create pipeline\n";
121121
return false;
122122
}
123123

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ bool HelloTriangleApplication::Initialize()
5555
// This section initializes DirectX's devices and SwapChain
5656
if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&_dxgiFactory))))
5757
{
58-
std::cout << "DXGI: Unable to create DXGIFactory\n";
58+
std::cout << "DXGI: Failed to create factory\n";
5959
return false;
6060
}
6161

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bool DebugLayerApplication::Initialize()
5353
// This section initializes DirectX's devices and SwapChain
5454
if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&_dxgiFactory))))
5555
{
56-
std::cout << "DXGI: Unable to create DXGIFactory\n";
56+
std::cout << "DXGI: Failed to create factory\n";
5757
return false;
5858
}
5959

@@ -75,7 +75,7 @@ bool DebugLayerApplication::Initialize()
7575
nullptr,
7676
&deviceContext)))
7777
{
78-
std::cout << "D3D11: Failed to create Device and Device Context\n";
78+
std::cout << "D3D11: Failed to create device and device context\n";
7979
return false;
8080
}
8181

@@ -110,7 +110,7 @@ bool DebugLayerApplication::Initialize()
110110
nullptr,
111111
&_swapChain)))
112112
{
113-
std::cout << "DXGI: Failed to create SwapChain\n";
113+
std::cout << "DXGI: Failed to create swapchain\n";
114114
return false;
115115
}
116116

@@ -129,7 +129,7 @@ bool DebugLayerApplication::Load()
129129
pipelineDescriptor.VertexType = VertexType::PositionColor;
130130
if (!_pipelineFactory->CreatePipeline(pipelineDescriptor, _pipeline))
131131
{
132-
std::cout << "PipelineFactory: Unable to create pipeline\n";
132+
std::cout << "PipelineFactory: Failed to create pipeline\n";
133133
return false;
134134
}
135135

@@ -173,7 +173,7 @@ bool DebugLayerApplication::CreateSwapchainResources()
173173
0,
174174
IID_PPV_ARGS(&backBuffer))))
175175
{
176-
std::cout << "D3D11: Failed to get Back Buffer from the SwapChain\n";
176+
std::cout << "D3D11: Failed to get back buffer from swapchain\n";
177177
return false;
178178
}
179179

@@ -182,7 +182,7 @@ bool DebugLayerApplication::CreateSwapchainResources()
182182
nullptr,
183183
&_renderTarget)))
184184
{
185-
std::cout << "D3D11: Failed to create RTV from Back Buffer\n";
185+
std::cout << "D3D11: Failed to create rendertarget view from back buffer\n";
186186
return false;
187187
}
188188

@@ -210,7 +210,7 @@ void DebugLayerApplication::OnResize(
210210
DXGI_FORMAT::DXGI_FORMAT_B8G8R8A8_UNORM,
211211
0)))
212212
{
213-
std::cout << "D3D11: Failed to recreate SwapChain buffers\n";
213+
std::cout << "D3D11: Failed to recreate swapchain buffers\n";
214214
return;
215215
}
216216

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bool NamingThingsApplication::Initialize()
5959
// This section initializes DirectX's devices and SwapChain
6060
if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&_dxgiFactory))))
6161
{
62-
std::cout << "DXGI: Unable to create DXGIFactory\n";
62+
std::cout << "DXGI: Failed to create factory\n";
6363
return false;
6464
}
6565

@@ -140,7 +140,7 @@ bool NamingThingsApplication::Load()
140140
pipelineDescriptor.VertexType = VertexType::PositionColor;
141141
if (!_pipelineFactory->CreatePipeline(pipelineDescriptor, _pipeline))
142142
{
143-
std::cout << "PipelineFactory: Unable to create pipeline\n";
143+
std::cout << "PipelineFactory: Failed to create pipeline\n";
144144
return false;
145145
}
146146

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bool ImageLibraryApplication::Initialize()
6161
// This section initializes DirectX's devices and SwapChain
6262
if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&_dxgiFactory))))
6363
{
64-
std::cout << "DXGI: Unable to create DXGIFactory\n";
64+
std::cout << "DXGI: Failed to create factory\n";
6565
return false;
6666
}
6767

@@ -142,7 +142,7 @@ bool ImageLibraryApplication::Load()
142142
pipelineDescriptor.VertexType = VertexType::PositionColorUv;
143143
if (!_pipelineFactory->CreatePipeline(pipelineDescriptor, _pipeline))
144144
{
145-
std::cout << "PipelineFactory: Unable to create pipeline\n";
145+
std::cout << "PipelineFactory: Failed to create pipeline\n";
146146
return false;
147147
}
148148

@@ -179,7 +179,7 @@ bool ImageLibraryApplication::Load()
179179
DirectX::ScratchImage scratchImage;
180180
if (FAILED(DirectX::LoadFromDDSFile(L"Assets/Textures/T_Froge.dds", DirectX::DDS_FLAGS_NONE, &metaData, scratchImage)))
181181
{
182-
std::cout << "DXTEX: Unable to load image\n";
182+
std::cout << "DXTEX: Failed to load image\n";
183183
return false;
184184
}
185185

@@ -191,7 +191,7 @@ bool ImageLibraryApplication::Load()
191191
metaData,
192192
&texture)))
193193
{
194-
std::cout << "DXTEX: Unable to create texture out of image\n";
194+
std::cout << "DXTEX: Failed to create texture out of image\n";
195195
scratchImage.Release();
196196
return false;
197197
}
@@ -203,7 +203,7 @@ bool ImageLibraryApplication::Load()
203203
metaData,
204204
&_textureSrv)))
205205
{
206-
std::cout << "DXTEX: Unable to create shader resource view out of texture\n";
206+
std::cout << "DXTEX: Failed to create shader resource view out of texture\n";
207207
scratchImage.Release();
208208
return false;
209209
}
@@ -217,7 +217,7 @@ bool ImageLibraryApplication::Load()
217217
linearSamplerStateDescriptor.AddressW = D3D11_TEXTURE_ADDRESS_MODE::D3D11_TEXTURE_ADDRESS_WRAP;
218218
if (FAILED(_device->CreateSamplerState(&linearSamplerStateDescriptor, &_linearSamplerState)))
219219
{
220-
std::cout << "D3D11: Unable to create linear sampler state\n";
220+
std::cout << "D3D11: Failed to create linear sampler state\n";
221221
return false;
222222
}
223223

@@ -233,7 +233,7 @@ bool ImageLibraryApplication::CreateSwapchainResources()
233233
0,
234234
IID_PPV_ARGS(&backBuffer))))
235235
{
236-
std::cout << "D3D11: Failed to get Back Buffer from the SwapChain\n";
236+
std::cout << "D3D11: Failed to get back buffer from swapchain\n";
237237
return false;
238238
}
239239

@@ -242,7 +242,7 @@ bool ImageLibraryApplication::CreateSwapchainResources()
242242
nullptr,
243243
&_renderTarget)))
244244
{
245-
std::cout << "D3D11: Failed to create RTV from Back Buffer\n";
245+
std::cout << "D3D11: Failed to create rendertarget view from back buffer\n";
246246
return false;
247247
}
248248

@@ -270,7 +270,7 @@ void ImageLibraryApplication::OnResize(
270270
DXGI_FORMAT::DXGI_FORMAT_B8G8R8A8_UNORM,
271271
0)))
272272
{
273-
std::cout << "D3D11: Failed to recreate SwapChain buffers\n";
273+
std::cout << "D3D11: Failed to recreate swapchain buffers\n";
274274
return;
275275
}
276276

src/Cpp/1-getting-started/1-3-2-LoadingMeshes-Refactored/LoadingMeshesApplication.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bool LoadingMeshesApplication::Initialize()
6565
// This section initializes DirectX's devices and SwapChain
6666
if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&_dxgiFactory))))
6767
{
68-
std::cout << "DXGI: Unable to create DXGIFactory\n";
68+
std::cout << "DXGI: Failed to create factory\n";
6969
return false;
7070
}
7171

@@ -88,7 +88,7 @@ bool LoadingMeshesApplication::Initialize()
8888
nullptr,
8989
&deviceContext)))
9090
{
91-
std::cout << "D3D11: Failed to create Device and Device Context\n";
91+
std::cout << "D3D11: Failed to create device and device context\n";
9292
return false;
9393
}
9494

@@ -127,7 +127,7 @@ bool LoadingMeshesApplication::Initialize()
127127
nullptr,
128128
&_swapChain)))
129129
{
130-
std::cout << "DXGI: Failed to create SwapChain\n";
130+
std::cout << "DXGI: Failed to create swapchain\n";
131131
return false;
132132
}
133133

@@ -149,7 +149,7 @@ bool LoadingMeshesApplication::Load()
149149
pipelineDescriptor.VertexType = VertexType::PositionColorUv;
150150
if (!_pipelineFactory->CreatePipeline(pipelineDescriptor, _pipeline))
151151
{
152-
std::cout << "PipelineFactory: Unable to create pipeline\n";
152+
std::cout << "PipelineFactory: Failed to create pipeline\n";
153153
return false;
154154
}
155155

@@ -173,7 +173,7 @@ bool LoadingMeshesApplication::Load()
173173
linearSamplerStateDescriptor.AddressW = D3D11_TEXTURE_ADDRESS_MODE::D3D11_TEXTURE_ADDRESS_WRAP;
174174
if (FAILED(_device->CreateSamplerState(&linearSamplerStateDescriptor, &_linearSamplerState)))
175175
{
176-
std::cout << "D3D11: Unable to create linear sampler state\n";
176+
std::cout << "D3D11: Failed to create linear sampler state\n";
177177
return false;
178178
}
179179

@@ -195,17 +195,17 @@ bool LoadingMeshesApplication::Load()
195195

196196
if (FAILED(_device->CreateBuffer(&constantBufferDescriptor, nullptr, &_constantBuffers[ConstantBufferType::PerApplication])))
197197
{
198-
std::cout << "D3D11: Unable to create constant buffer PerApplication\n";
198+
std::cout << "D3D11: Failed to create constant buffer PerApplication\n";
199199
return false;
200200
}
201201
if (FAILED(_device->CreateBuffer(&constantBufferDescriptor, nullptr, &_constantBuffers[ConstantBufferType::PerFrame])))
202202
{
203-
std::cout << "D3D11: Unable to create constant buffer PerFrame\n";
203+
std::cout << "D3D11: Failed to create constant buffer PerFrame\n";
204204
return false;
205205
}
206206
if (FAILED(_device->CreateBuffer(&constantBufferDescriptor, nullptr, &_constantBuffers[ConstantBufferType::PerObject])))
207207
{
208-
std::cout << "D3D11: Unable to create constant buffer PerObject\n";
208+
std::cout << "D3D11: Failed to create constant buffer PerObject\n";
209209
return false;
210210
}
211211

@@ -231,7 +231,7 @@ bool LoadingMeshesApplication::CreateSwapchainResources()
231231
0,
232232
IID_PPV_ARGS(&backBuffer))))
233233
{
234-
std::cout << "D3D11: Failed to get Back Buffer from the SwapChain\n";
234+
std::cout << "D3D11: Failed to get back buffer from the swapchain\n";
235235
return false;
236236
}
237237

@@ -240,7 +240,7 @@ bool LoadingMeshesApplication::CreateSwapchainResources()
240240
nullptr,
241241
&_renderTarget)))
242242
{
243-
std::cout << "D3D11: Failed to create RTV from Back Buffer\n";
243+
std::cout << "D3D11: Failed to create rendertarget view from back buffer\n";
244244
return false;
245245
}
246246

@@ -268,7 +268,7 @@ void LoadingMeshesApplication::OnResize(
268268
DXGI_FORMAT::DXGI_FORMAT_B8G8R8A8_UNORM,
269269
0)))
270270
{
271-
std::cout << "D3D11: Failed to recreate SwapChain buffers\n";
271+
std::cout << "D3D11: Failed to recreate swapchain buffers\n";
272272
return;
273273
}
274274

src/Cpp/1-getting-started/1-3-2-LoadingMeshes-Refactored/ModelFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bool ModelFactory::LoadModel(
3131

3232
if (scene == nullptr)
3333
{
34-
std::cout << "ASSIMP: Unable to load model file\n";
34+
std::cout << "ASSIMP: Failed to load model file\n";
3535
return false;
3636
}
3737

0 commit comments

Comments
 (0)