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? :?
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? :?
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.
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? :?Originally Posted by grudzio
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).Originally Posted by Brainer
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.I use dglOpenGL.pas and I doubt such a declaration is in that file. Am I wrong?
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).
Well, from now on I'll be using glx.pas. By the way - grudzio, can you send me OpenGL libraries suitable for Linux, please?
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.
Okay, thanks for your precious information and time!
A przy okazji, to pozdrawiam rodaka! Sorry for non-English sentence
Bookmarks