Skip to content

Commit 0ab5503

Browse files
author
Floyd Huizinga
committed
vertexOffset was a bit less optional then the docs said...
1 parent 33e5ef3 commit 0ab5503

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,13 @@ void TexturingApplication::Update()
405405
void TexturingApplication::Render()
406406
{
407407
float clearColor[] = { 0.1f, 0.1f, 0.1f, 1.0f };
408+
constexpr UINT vertexOffset = 0;
408409

409410
ID3D11RenderTargetView* nullTarget = nullptr;
410411

411412
//set to 0 so we can clear properly
412413
_deviceContext->OMSetRenderTargets(1, &nullTarget, nullptr);
413414
_deviceContext->ClearRenderTargetView(_renderTarget.Get(), clearColor);
414-
415415
_deviceContext->OMSetRenderTargets(1, _renderTarget.GetAddressOf(), nullptr);
416416

417417
_deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY::D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
@@ -424,7 +424,7 @@ void TexturingApplication::Render()
424424
1,
425425
_triangleVertices.GetAddressOf(),
426426
&stride,
427-
nullptr);
427+
&vertexOffset);
428428

429429
_shaderCollection.ApplyToContext(_deviceContext.Get());
430430

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ void Setting3DApplication::Update()
483483
void Setting3DApplication::Render()
484484
{
485485
float clearColor[] = { 0.1f, 0.1f, 0.1f, 1.0f };
486-
486+
constexpr UINT vertexOffset = 0;
487487
ID3D11RenderTargetView* nullTarget = nullptr;
488488

489489
//set to 0 so we can clear properly
@@ -502,7 +502,7 @@ void Setting3DApplication::Render()
502502
1,
503503
_triangleVertices.GetAddressOf(),
504504
&stride,
505-
nullptr);
505+
&vertexOffset);
506506

507507
_shaderCollection.ApplyToContext(_deviceContext.Get());
508508

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ void Rendering3DApplication::Update()
401401
void Rendering3DApplication::Render()
402402
{
403403
float clearColor[] = { 0.1f, 0.1f, 0.1f, 1.0f };
404+
constexpr UINT vertexOffset = 0;
404405

405406
ID3D11RenderTargetView* nullRTV = nullptr;
406407

@@ -420,7 +421,7 @@ void Rendering3DApplication::Render()
420421
1,
421422
_cubeVertices.GetAddressOf(),
422423
&stride,
423-
nullptr);
424+
&vertexOffset);
424425

425426
_deviceContext->IASetIndexBuffer(
426427
_cubeIndices.Get(),

0 commit comments

Comments
 (0)