Revert scaling changes. It breaks pickbuffers on Windows with DPI scaling. Needs more investigation.

This reverts commit d901177489.
This commit is contained in:
milek7
2021-01-24 15:38:48 +01:00
parent ad7c0622f8
commit 34113bf7e7
3 changed files with 7 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
/*
/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
@@ -69,16 +69,13 @@ void focus_callback( GLFWwindow *window, int focus ) {
void window_resize_callback( GLFWwindow *window, int w, int h ) {
// NOTE: we have two variables which basically do the same thing as we don't have dynamic fullscreen toggle
// TBD, TODO: merge them?
#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3)
glfwGetWindowContentScale(window, &Global.fWindowXScale, &Global.fWindowYScale);
#endif
Global.iWindowWidth = w;
Global.iWindowHeight = h;
glViewport( 0, 0, w, h );
}
void cursor_pos_callback( GLFWwindow *window, double x, double y ) {
Application.on_cursor_pos( x * Global.fWindowXScale, y * Global.fWindowXScale);
Application.on_cursor_pos( x, y );
}
void mouse_button_callback( GLFWwindow* window, int button, int action, int mods )
@@ -486,7 +483,7 @@ eu07_application::set_cursor( int const Mode ) {
void
eu07_application::set_cursor_pos( double const Horizontal, double const Vertical ) {
glfwSetCursorPos( m_windows.front(), Horizontal / Global.fWindowXScale, Vertical / Global.fWindowYScale);
glfwSetCursorPos( m_windows.front(), Horizontal, Vertical );
}
glm::dvec2
@@ -496,9 +493,6 @@ eu07_application::get_cursor_pos() const {
if( !m_windows.empty() ) {
glfwGetCursorPos( m_windows.front(), &pos.x, &pos.y );
}
pos.x *= Global.fWindowXScale;
pos.y *= Global.fWindowYScale;
return pos;
}
@@ -506,9 +500,6 @@ void
eu07_application::get_cursor_pos( double &Horizontal, double &Vertical ) const {
glfwGetCursorPos( m_windows.front(), &Horizontal, &Vertical );
Horizontal *= Global.fWindowXScale;
Vertical *= Global.fWindowYScale;
}
/*