Fix OpenGL samples when using HiDPI displays
OpenGL seems to operate using physical pixels, so we need to factor in the scale factor when setting the GL viewport. Closes #17391. Closes https://github.com/wxWidgets/wxWidgets/pull/1470
This commit is contained in:
committed by
Vadim Zeitlin
parent
0ff713c945
commit
b134589cbb
@@ -280,7 +280,8 @@ void TestGLCanvas::OnSize(wxSizeEvent& event)
|
||||
// This is OK here only because there is only one canvas that uses the
|
||||
// context. See the cube sample for that case that multiple canvases are
|
||||
// made current with one context.
|
||||
glViewport(0, 0, event.GetSize().x, event.GetSize().y);
|
||||
const wxSize size = event.GetSize() * GetContentScaleFactor();
|
||||
glViewport(0, 0, size.x, size.y);
|
||||
}
|
||||
|
||||
void TestGLCanvas::OnChar(wxKeyEvent& event)
|
||||
|
Reference in New Issue
Block a user