Ticket #17391: opengl_samples_win.patch

File opengl_samples_win.patch, 2.7 KB (added by tm, 12 months ago)

Patch for Windows

  • samples/opengl/cube/cube.cpp

    diff --git a/samples/opengl/cube/cube.cpp b/samples/opengl/cube/cube.cpp
    index 254812e..9babf67 100644
    a b void TestGLCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) 
    349349    // multiple canvases: If we updated the viewport in the wxSizeEvent
    350350    // handler, changing the size of one canvas causes a viewport setting that
    351351    // is wrong when next another canvas is repainted.
     352#if defined __WXGTK3__ || defined __WXOSX__
    352353    const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
     354#else
     355    const wxSize ClientSize = GetClientSize();
     356#endif
    353357
    354358    TestGLContext& canvas = wxGetApp().GetContext(this, m_useStereo);
    355359    glViewport(0, 0, ClientSize.x, ClientSize.y);
  • samples/opengl/isosurf/isosurf.cpp

    diff --git a/samples/opengl/isosurf/isosurf.cpp b/samples/opengl/isosurf/isosurf.cpp
    index 9dd47a1..591d5a4 100644
    a b void TestGLCanvas::OnSize(wxSizeEvent& event) 
    280280    // This is OK here only because there is only one canvas that uses the
    281281    // context. See the cube sample for that case that multiple canvases are
    282282    // made current with one context.
     283#if defined __WXGTK3__ || defined __WXOSX__
    283284    const wxSize size = event.GetSize() * GetContentScaleFactor();
     285#else
     286    const wxSize size = event.GetSize();
     287#endif
    284288    glViewport(0, 0, size.x, size.y);
    285289}
    286290
  • samples/opengl/penguin/penguin.cpp

    diff --git a/samples/opengl/penguin/penguin.cpp b/samples/opengl/penguin/penguin.cpp
    index b5992a6..e824494 100644
    a b void TestGLCanvas::ResetProjectionMode() 
    306306    // or more than one wxGLContext in the application.
    307307    SetCurrent(*m_glRC);
    308308
     309#if defined __WXGTK3__ || defined __WXOSX__
    309310    const wxSize ClientSize = GetClientSize() * GetContentScaleFactor();
     311#else
     312    const wxSize ClientSize = GetClientSize();
     313#endif
    310314
    311315    // It's up to the application code to update the OpenGL viewport settings.
    312316    // In order to avoid extensive context switching, consider doing this in
  • samples/opengl/pyramid/pyramid.cpp

    diff --git a/samples/opengl/pyramid/pyramid.cpp b/samples/opengl/pyramid/pyramid.cpp
    index 5123a91..77473fa 100644
    a b void MyGLCanvas::OnSize(wxSizeEvent& event) 
    565565    SetCurrent(*m_oglContext);
    566566
    567567    // It's up to the application code to update the OpenGL viewport settings.
     568#if defined __WXGTK3__ || defined __WXOSX__
    568569    const wxSize size = event.GetSize() * GetContentScaleFactor();
     570#else
     571    const wxSize size = event.GetSize();
     572#endif
    569573    m_winHeight = size.y;
    570574    m_oglManager->SetViewport(0, 0, size.x, m_winHeight);
    571575