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
@@ -349,7 +349,7 @@ void TestGLCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
// multiple canvases: If we updated the viewport in the wxSizeEvent
|
||||
// handler, changing the size of one canvas causes a viewport setting that
|
||||
// is wrong when next another canvas is repainted.
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
|
||||
|
||||
TestGLContext& canvas = wxGetApp().GetContext(this, m_useStereo);
|
||||
glViewport(0, 0, ClientSize.x, ClientSize.y);
|
||||
|
Reference in New Issue
Block a user