mirror of https://github.com/encounter/SDL.git
Fixed bug 2421 for D3D11 - SDL_RenderCopyEx off by one when rotating by 90 and -90.
Nader Golbaz Updated patch for direct3d renderers
This commit is contained in:
parent
4ed4997cc4
commit
330e2952d8
|
@ -2518,7 +2518,7 @@ D3D11_RenderDrawPoints(SDL_Renderer * renderer,
|
||||||
|
|
||||||
vertices = SDL_stack_alloc(VertexPositionColor, count);
|
vertices = SDL_stack_alloc(VertexPositionColor, count);
|
||||||
for (i = 0; i < count; ++i) {
|
for (i = 0; i < count; ++i) {
|
||||||
const VertexPositionColor v = { { points[i].x, points[i].y, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } };
|
const VertexPositionColor v = { { points[i].x + 0.5f, points[i].y + 0.5f, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } };
|
||||||
vertices[i] = v;
|
vertices[i] = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2557,7 +2557,7 @@ D3D11_RenderDrawLines(SDL_Renderer * renderer,
|
||||||
|
|
||||||
vertices = SDL_stack_alloc(VertexPositionColor, count);
|
vertices = SDL_stack_alloc(VertexPositionColor, count);
|
||||||
for (i = 0; i < count; ++i) {
|
for (i = 0; i < count; ++i) {
|
||||||
const VertexPositionColor v = { { points[i].x, points[i].y, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } };
|
const VertexPositionColor v = { { points[i].x + 0.5f, points[i].y + 0.5f, 0.0f }, { 0.0f, 0.0f }, { r, g, b, a } };
|
||||||
vertices[i] = v;
|
vertices[i] = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2576,6 +2576,7 @@ D3D11_RenderDrawLines(SDL_Renderer * renderer,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
D3D11_RenderFinishDrawOp(renderer, D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP, count);
|
D3D11_RenderFinishDrawOp(renderer, D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP, count);
|
||||||
|
D3D11_RenderFinishDrawOp(renderer, D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, count);
|
||||||
SDL_stack_free(vertices);
|
SDL_stack_free(vertices);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue