Fix two minor issues with D3D UI

This commit is contained in:
Henrik Rydgard 2017-02-08 17:09:59 +01:00
parent 5bd62c99a6
commit 9dd3e18ed4
2 changed files with 4 additions and 1 deletions

View File

@ -741,12 +741,14 @@ void NativeRender(GraphicsContext *graphicsContext) {
ortho.setOrthoD3D(0.0f, xres, 0, yres, -1.0f, 1.0f);
break;
case GPUBackend::DIRECT3D9:
case GPUBackend::DIRECT3D11:
ortho.setOrthoD3D(0.0f, xres, yres, 0.0f, -1.0f, 1.0f);
Matrix4x4 translation;
translation.setTranslation(Vec3(-0.5f, -0.5f, 0.0f));
ortho = translation * ortho;
break;
case GPUBackend::DIRECT3D11:
ortho.setOrthoD3D(0.0f, xres, yres, 0.0f, -1.0f, 1.0f);
break;
case GPUBackend::OPENGL:
ortho.setOrtho(0.0f, xres, yres, 0.0f, -1.0f, 1.0f);
break;

View File

@ -436,6 +436,7 @@ RasterState *D3D11DrawContext::CreateRasterState(const RasterStateDesc &desc) {
case CullMode::NONE: d3ddesc.CullMode = D3D11_CULL_NONE; break;
}
d3ddesc.FrontCounterClockwise = desc.frontFace == Facing::CCW;
d3ddesc.ScissorEnable = true; // We always run with scissor enabled
if (SUCCEEDED(device_->CreateRasterizerState(&d3ddesc, &rs->rs)))
return rs;
delete rs;