Results 1 to 5 of 5

Thread: Initial swap interval in CL_DisplayWindowDescription

  1. #1

    Default Initial swap interval in CL_DisplayWindowDescription

    Hi,

    Currently ClanLib doesn't allow to specify a swap interval during the render window creation, only later in flip() function. The initial swap interval should be useful for:

    • Direct3D display targets, which require swap interval in the device presentation parameters;
    • ClanGUI applications, because there is no easy way to setup vsync before CL_GUIManager::exec() call, e.g. in GUIBasic example.

    The attached patch adds two public functions get_swap_interval()/set_swap_interval() to CL_DisplayWindowDescription class and perform necessary changes in the display targets. So, any chances to see this in the next ClanLib releases?
    Attached Files Attached Files

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    I like it.

    It is useful for clanGUI

    As far as I know, nobody is working on or plan to work on the DirectX9/10 targets.
    Currently these display targets are disabled (in Setup/configure-90.sln)

    They "should" compile. D3D9 has some basic code inside it. D3D10 is empty.

    Since your patch does not break any API, it could also be added to the ClanLib-2.2 branch.

  3. #3

    Default

    I've updated to the latest SVN version, but it seems this patch isn't applied yet.

    Currently I use something like this:
    Code:
    CL_Window window(&gui, desc);
    window.set_constant_repaint(true);
    window.get_display_window().flip(config.vsync);
    
    gui.exec();
    but it looks a bit hacky for me.

    Also swap interval could be added as a parameter to CL_DisplayWindow constructor.

    It's sadly that nobody interests in DirectX support, since it's a primary rendering API on Windows. Maybe I'll work on it for my project if all goes well.

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Quote Originally Posted by toiffel View Post
    I've updated to the latest SVN version, but it seems this patch isn't applied yet.
    Sorry, I have not had any spare time to apply it.

    It will be applied, it's a good patch. I'll try to do it next week.

    It will be in the next ClanLib 2.2.2 release

  5. #5
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Patch applied, many thanks.

    Sorry for the delay

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •