Thread: Xorg config
View Single Post
Old 10th January 2010
There0 There0 is offline
./dev/null
 
Join Date: Jul 2008
Posts: 169
Default

Quote:
No, source code is not part of the base install, it is something admins do post-install, per FAQ 5.
Well aware of that, also what a .c file is for, this admin puts the source files in /usr/src for some reason though,was just wondering if it was a -current thing and i was missing out on the fun

I was not aware that it was published online, although i did expect it, thx for link to info, i will of course review it

Code:
/**
 * Attempt to determine whether or not the display is synched to vblank.
 */
void
query_vsync(Display *dpy)
{
   int interval = 0;


#ifdef GLX_MESA_swap_control
   if ((interval <= 0)
       && is_glx_extension_supported(dpy, "GLX_MESA_swap_control")) {
      PFNGLXGETSWAPINTERVALMESAPROC pglXGetSwapIntervalMESA =
          (PFNGLXGETSWAPINTERVALMESAPROC)
          glXGetProcAddressARB((const GLubyte *) "glXGetSwapIntervalMESA");

      interval = (*pglXGetSwapIntervalMESA)();
   }
#endif


#ifdef GLX_SGI_video_sync
   if ((interval <= 0)
       && is_glx_extension_supported(dpy, "GLX_SGI_video_sync")) {
      PFNGLXGETVIDEOSYNCSGIPROC pglXGetVideoSyncSGI =
          (PFNGLXGETVIDEOSYNCSGIPROC)
          glXGetProcAddressARB((const GLubyte *) "glXGetVideoSyncSGI");
      unsigned count;

      if ((*pglXGetVideoSyncSGI)(& count) == 0) {
         interval = (int) count;
      }
   }
#endif


   if (interval > 0) {
      printf("Running synchronized to the vertical refresh.  The framerate should be\n");
      if (interval == 1) {
         printf("approximately the same as the monitor refresh rate.\n");
      } else if (interval > 1) {
         printf("approximately 1/%d the monitor refresh rate.\n",
                interval);
      }
   }
}
__________________
The more you learn, the more you realize how little you know ....
Reply With Quote