[Git][wxwidgets/wxwidgets][master] 24 commits: Add wxGLCanvas::SetSwapInterval() and GetSwapInterval()

2 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Feb 9, 2026, 7:11:24 PM (7 days ago) Feb 9
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 104dad30
    by Vadim Zeitlin at 2026-02-06T17:57:33+01:00
    Add wxGLCanvas::SetSwapInterval() and GetSwapInterval()
    
    Allow setting the swap interval value or not setting it at all instead
    of always forcing it to 0.
    
    The changes of 3dde6bdeb0 (Disable swap interval in GLX wxGLCanvas
    implementation too, 2023-12-25) are not always desirable, so allow to
    customize the behaviour.
    
    Implement this for Unix (GLX and EGL) backends for now and allow testing
    using these functions in the cube sample.
    
    See #24163, #24165.
    
  • 1816797a
    by Vadim Zeitlin at 2026-02-06T18:03:37+01:00
    Check for GLX_EXT_swap_control availability
    
    glXSwapIntervalEXT() might exist in the client library but not be
    actually supported by the driver, so check if it advertises the
    extension defining this function.
    
    Also don't query GLX_SWAP_INTERVAL_EXT if this extension is not
    available as it would generate an X error.
    
  • 3b4b8971
    by Vadim Zeitlin at 2026-02-06T18:11:47+01:00
    Fall back on GLX_MESA_swap_control if GLX_EXT_swap_control is NA
    
    Try using the older extension if we don't have the newer one.
    
  • 3b91e1a3
    by Vadim Zeitlin at 2026-02-06T18:48:58+01:00
    Remove unused WXGLSwapBuffers() function
    
    This seems to have never been used in Cocoa wxOSX version and is
    definitely not used currently.
    
  • 9b2fb947
    by Vadim Zeitlin at 2026-02-07T15:19:03+01:00
    Implement support for wxGLCanvas swap interval in wxOSX
    
    Just use NSOpenGLCPSwapInterval parameter for this.
    
  • 5949a96c
    by Vadim Zeitlin at 2026-02-07T15:19:03+01:00
    Implement support for wxGLCanvas swap interval in wxMSW
    
    Just call the corresponding WGL_EXT_swap_control extension functions if
    available.
    
  • 688b5520
    by Vadim Zeitlin at 2026-02-07T16:30:53+01:00
    Add support for requesting adaptive VSync to wxGLCanvas
    
    Mimic the low level OpenGL APIs by allowing to pass -1 to
    SetSwapInterval() to request adaptive VSync and implement this for GLX
    and WGL.
    
    Change return type of SetSwapInterval() to allow returning a value
    indicating that enabling adaptive VSync failed but standard VSync could
    still be set.
    
  • cf477f05
    by Vadim Zeitlin at 2026-02-07T19:17:07+01:00
    Call wxD2DContext::EnsureInitialized() only once
    
    It seems useless to call it again as it effectively does nothing after
    the first call (just reassigns the same value to m_cachedRenderTarget).
    
  • 59b45116
    by Vadim Zeitlin at 2026-02-07T19:19:16+01:00
    Rename wxD2DContext::m_cachedRenderTarget to just m_target
    
    Also use it instead of repeatedly calling GetRenderTarget() in
    EnsureInitialized().
    
    No real changes.
    
  • faa26a03
    by David Hansel at 2026-02-07T19:21:34+01:00
    Handle errors in wxD2DRenderer::CreateContext() better
    
    Don't assert and then crash if BindDC() call fails, just returns a null
    context pointer instead and let the application to deal with it.
    
    Closes #26052.
    
    Co-authored-by: Vadim Zeitlin <va...@wxwidgets.org>
    
  • 1214091e
    by AliKet at 2026-02-08T13:25:15+01:00
    Add move constructor to wxWindowDisabler class
    
    Will be needed when we add modal window support to wxFrame in the
    upcoming commits. i.e.: construct wxWindowDisabler objects directly
    in a std::stack<>.
    
  • b337de50
    by AliKet at 2026-02-08T13:25:15+01:00
    Initialize wxFrameBase members in their declarations
    
    No real changes.
    
  • 7a605106
    by AliKet at 2026-02-08T13:25:15+01:00
    Add wxFrameBase::SetWindowModality() member function
    
  • f06fd47c
    by AliKet at 2026-02-08T13:25:15+01:00
    Initialize wxPreviewFrame members in their declarations
    
    No real changes.
    
  • d4ee5c44
    by AliKet at 2026-02-08T13:25:15+01:00
    Re-define wxPreviewFrameModalityKind as an alias to wxFrameBase::ModalityKind
    
    and keep it to maintain backward compatibility.
    
  • e16a14d5
    by AliKet at 2026-02-08T13:25:16+01:00
    Call the base class function to set the wxPreviewFrame modality
    
  • 6d92b391
    by AliKet at 2026-02-08T13:25:16+01:00
    Fix printing sample compilation after recent changes
    
  • a5c4bb98
    by AliKet at 2026-02-08T13:25:17+01:00
    wxQt: Override wxFrameBase::SetWindowModality()
    
    Quoting the Qt documentation (QWidget::setEnabled()):
    
    	Disabling a widget implicitly disables all its children. ... It it not
    	possible to explicitly enable a child widget which is not a window while
    	its parent widget remains disabled.
    
    This means implementing window modality using wxWindowDisabler(winToSkip) to
    make winToSkip behave like a modal window to the application, or as a modal
    window to its parent (by just disabling the parent window) WILL NOT WORK in Qt
    and this is by design. IOW, wxWindowDisabler always disables everything in wxQt.
    
  • 19dc2505
    by CloverGit at 2026-02-09T18:43:39+01:00
    Update zh_CN translation
    
    Closes #26175.
    
  • 208ad273
    by Vadim Zeitlin at 2026-02-09T18:47:04+01:00
    Merge branch 'gl-swap'
    
    Allow controlling VSync in wxGLCanvas.
    
    See #25449.
    
  • 8fb895a7
    by Vadim Zeitlin at 2026-02-09T18:52:42+01:00
    Merge branch 'd2d-better-error-handling'
    
    Improve error handling in D2D code.
    
    See #26169.
    
  • de8545b8
    by Vadim Zeitlin at 2026-02-10T00:57:03+01:00
    Merge branch 'frame_modality' of github.com:AliKet/wxWidgets
    
    Add window modality support to wxFrame.
    
    See #26147.
    
  • 5d26584c
    by PB at 2026-02-10T01:03:52+01:00
    Allow running tests from MSVS in DLL configurations
    
    Create file tests/tests.props which adds the DLL build directory
    to MSVS PATH in <LocalDebuggerEnvironment> property and add the
    file to test.vcxproj and test_gui.vcxproj MSVC projects.
    
    See also eba106431a (Allow running samples from MSVS in DLL
    configurations, 2024-11-14).
    
    Closes #26171.
    
  • acd8b729
    by Daniel Collins at 2026-02-10T01:05:59+01:00
    Document that wxApp::OnExit() should be called from overrides
    
    And update the samples to follow the advice in the documentation.
    
    Closes #26173.
    

42 changed files:

The diff was not included because it is too large.
Reply all
Reply to author
Forward
0 new messages