New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
D3D: Reset viewport before drawing the OSD. #497
Conversation
| float scalex = 1 / (float)D3D::GetBackBufferWidth() * 2.f; | ||
| float scaley = 1 / (float)D3D::GetBackBufferHeight() * 2.f; | ||
| float scalex = 1 / (float)width * 2.f; | ||
| float scaley = 1 / (float)height * 2.f; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Pictures please! |
|
It's probably better if you use a build: https://dl.dolphin-emu.org/prs/pr-497-dolphin-latest-x64.7z Anyway, here's a screenshot: https://www.dropbox.com/s/7fq9zss0riroypb/Screenshot%202014-06-16%2009.50.49.png |
|
+1, this always annoyed me in d3d11 backend :) |
|
The result is not the same as OpenGL yet, in OpenGL the OSD is positioned relative to the window instead of the target rectangle. However D3D has always positioned the OSD relative to the target rectangle, so I suggest we merge this PR to fix the current code before we try to improve it. |
| @@ -257,7 +257,9 @@ Renderer::~Renderer() | |||
|
|
|||
| void Renderer::RenderText(const std::string& text, int left, int top, u32 color) | |||
| { | |||
| D3D::font.DrawTextScaled((float)left, (float)top, 20.f, 0.0f, color, text); | |||
| int Width = GetTargetRectangle().right - GetTargetRectangle().left; | |||
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Comparing it to OpenGL it's become clear to me that the PR in it's current state is just fighting symptoms. I'm close to a different fix that matches the behaviour of OpenGL, please don't merge this yet. What's happening is that D3D forgets to reset the viewport before drawing the OSD. OpenGL does that here: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoBackends/OGL/Render.cpp#L683 |
|
Okay, now it's really fixed and acts the same as the OGL backend. https://www.dropbox.com/s/7lui3rot5uwsx8i/Screenshot%202014-06-16%2023.37.01.png |
|
I did a git blame and this is where the OSD was broken: d0f00ce#diff-8faba6592c6d673394e05ac51410dc79L928 The PR is ready for merge btw. |
|
Looks good to me, for what it's worth. |
D3D: Reset viewport before drawing the OSD.
Previous code didn't reset the viewport before drawing the OSD, so the OSD was constrained to the target rectangle.