From 057bca8a68dd3159fe10bff3c19958ae965536d3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 6 Nov 2016 15:15:32 -0800 Subject: [PATCH] Better fix for last point in D3D11 renderer, thanks to Nader Golbaz --- src/render/direct3d11/SDL_render_d3d11.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 1ee95ad7a..728cb16d7 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -2576,7 +2576,12 @@ D3D11_RenderDrawLines(SDL_Renderer * renderer, NULL); D3D11_RenderFinishDrawOp(renderer, D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP, count); - D3D11_RenderFinishDrawOp(renderer, D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, count); + + if (points[0].x != points[count - 1].x || points[0].y != points[count - 1].y) { + ID3D11DeviceContext_IASetPrimitiveTopology(rendererData->d3dContext, D3D11_PRIMITIVE_TOPOLOGY_POINTLIST); + ID3D11DeviceContext_Draw(rendererData->d3dContext, 1, count - 1); + } + SDL_stack_free(vertices); return 0; }