Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Disabling VSync on Linux

  1. #1

    Disabling VSync on Linux

    Hello.

    I use this snippet to disable VSync on Windows:
    [pascal]
    uses
    dglOpenGL;
    (...)
    if WGL_EXT_swap_control then
    wglSwapIntervalEXT(0);
    [/pascal]

    But how to disable VSync on Linux? :?

  2. #2

    Disabling VSync on Linux

    The DRI scans ~/.drirc and will use the VSYNC behaviour specified in that file. You cannot override this, I checked the source code for that. Yes, it sucks.

  3. #3

    Disabling VSync on Linux

    How about GLX_SGI_swap_control extension?

  4. #4

    Disabling VSync on Linux

    Quote Originally Posted by grudzio
    How about GLX_SGI_swap_control extension?
    Oh, I've never heard of such an extension! I suppose there is a function called glxSwapIntervalEXT(), am I right? :?

  5. #5

    Disabling VSync on Linux

    Quote Originally Posted by Brainer
    Oh, I've never heard of such an extension! I suppose there is a function called glxSwapIntervalEXT(), am I right? :?
    glXSwapIntervalSGI to be exact. I haven't found its declaration in glx shipped with fpc compiler (2.0.4) so You may have to modify the glx.pas file (or any other OpenGL header You are using).

  6. #6

    Disabling VSync on Linux

    I use dglOpenGL.pas and I doubt such a declaration is in that file. Am I wrong?

  7. #7

    Disabling VSync on Linux

    I use dglOpenGL.pas and I doubt such a declaration is in that file. Am I wrong?
    I don't know. I am using JEDI_SDL OpenGL headers. Last time I looked at dglOpenGL.pas (about two years ago) it didn't have any glx stuff in it.

    My suggestion is to get the JEDI_SDL glx.pas and modify it to include glXSwapIntervalSGI.
    In the interface section add the following line to the MESA extensions
    [pascal]
    glXSwapIntervalSGI: function(interval: Integer): Integer; cdecl;
    [/pascal]
    Then modify InitGLXFromLibrary function by adding the following line
    [pascal]
    glXSwapIntervalSGI := GetModuleSymbol(libglx, 'glXSwapIntervalSGI');
    [/pascal]
    Then include glx.pas in Your project, compile and hope for the best.

    If you don't use JEDI_SDL you may want to make these changes to the glx.pas that comes with FPC, since JEDI_SDL uses its own functions for loading dynamic libraries (defined in moduleloader.pas).

  8. #8

    Disabling VSync on Linux

    Well, from now on I'll be using glx.pas. By the way - grudzio, can you send me OpenGL libraries suitable for Linux, please?

  9. #9

    Disabling VSync on Linux

    Any compiler that runs under Linux with support for OpenGL will have appopriate headers. The glx file contains only functions that are specific for X Windows System. They are X window equivalents of MS Windows wgl and MacOS agl functions. The core of OpenGL library contained in gl and glu files is same for all platforms.

  10. #10

    Disabling VSync on Linux

    Okay, thanks for your precious information and time!
    A przy okazji, to pozdrawiam rodaka! Sorry for non-English sentence

Page 1 of 2 12 LastLast

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
  •