Hi,

referring to our discussion on IRC on monday about querying client
driver configuration options I made a small programme which just reads
the client driver names of all screens. It's pretty simple actually. No
need for any GLX initialization at all. The source is attached. Compile
like this:

cc -I$dritrunk/xc/xc/lib/GL/dri 
-I$dritrunk/xc/xc/programs/Xserver/hw/xfree86/os-support -lX11 -lXext detectdrv.c 
$dritrunk/xc/xc/lib/GL/dri/XF86dri.o -o detectdrv

Regards,
   Felix

               __\|/__    ___     ___     ___
__Tschüß_______\_6 6_/___/__ \___/__ \___/___\___You can do anything,___
_____Felix_______\Ä/\ \_____\ \_____\ \______U___just not everything____
  [EMAIL PROTECTED]    >o<__/   \___/   \___/        at the same time!
#include <stdio.h>
#include <X11/Xlib.h>
#include <xf86dri.h>

int main () {
    Display *display;
    int major, minor, patch, screenCount, i;
    Bool capable;
    char *driver;

    if (!(display = XOpenDisplay (NULL))) {
	fprintf (stderr, "Error: Couldn't open display\n");
	return 1;
    }

    screenCount = ScreenCount (display);
    printf ("ScreenCount=%d\n", screenCount);
    for (i = 0; i < screenCount; ++i) {
	if (!XF86DRIQueryDirectRenderingCapable(display, i, &capable))
	    fprintf (stderr, "DRI call failed\n");
	else if (!capable) {
	    printf ("Screen %d: not direct rendering capable\n");
	    continue;
	}
	if (!XF86DRIGetClientDriverName (display, i, &major, &minor, &patch, &driver))
	    fprintf (stderr, "DRI call failed\n");
	else
	    printf ("Screen %d: %s %d.%d-%d\n", i, driver, major, minor, patch);
    }

    XCloseDisplay (display);
}

Reply via email to