Commit c43ba5ed authored by Sam Lantinga's avatar Sam Lantinga

Fixed line drawing for D3D

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404299
parent 4b9d4ff3
...@@ -1012,8 +1012,17 @@ D3D_RenderLines(SDL_Renderer * renderer, const SDL_Point * points, int count) ...@@ -1012,8 +1012,17 @@ D3D_RenderLines(SDL_Renderer * renderer, const SDL_Point * points, int count)
vertices[i].v = 0.0f; vertices[i].v = 0.0f;
} }
result = result =
IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, count, IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, count-1,
vertices, sizeof(*vertices)); vertices, sizeof(*vertices));
/* DirectX 9 has the same line rasterization semantics as GDI,
so we need to close the endpoint of the line */
if (points[0].x != points[count-1].x || points[0].y != points[count-1].y) {
vertices[0].x = (float) points[count-1].x;
vertices[0].y = (float) points[count-1].y;
result = IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, 1, vertices, sizeof(*vertices));
}
SDL_stack_free(vertices); SDL_stack_free(vertices);
if (FAILED(result)) { if (FAILED(result)) {
D3D_SetError("DrawPrimitiveUP()", result); D3D_SetError("DrawPrimitiveUP()", result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment