5 int main(int argc
, char **argv
)
11 dri_drawable_t
*dri_drawable
;
12 dri_context_t
*context
;
14 dpy
= XOpenDisplay(NULL
);
15 root
= XDefaultRootWindow(dpy
);
16 window
= XCreateSimpleWindow(dpy
, root
, 0, 0, 100, 100, 0, 0, 0);
18 XSelectInput(dpy
, window
, 0);
19 XMapWindow(dpy
, window
);
22 assert(driCreateScreen(dpy
, 0, &screen
, NULL
) == 0);
23 assert(driCreateDrawable(screen
, window
, &dri_drawable
) == 0);
24 assert(driCreateContext(screen
, XDefaultVisual(dpy
, 0), &context
) == 0);
25 assert(driUpdateDrawableInfo(dri_drawable
) == 0);
27 DRI_VALIDATE_DRAWABLE_INFO(screen
, dri_drawable
);
29 assert(drmGetLock(screen
->fd
, context
->drm_context
, 0) == 0);
30 assert(drmUnlock(screen
->fd
, context
->drm_context
) == 0);
32 assert(driDestroyContext(context
) == 0);
33 assert(driDestroyDrawable(dri_drawable
) == 0);
34 assert(driDestroyScreen(screen
) == 0);
36 XDestroyWindow(dpy
, window
);