コード例 #1
0
ファイル: egl_epoxy_api.c プロジェクト: ebassi/libepoxy
int
main(int argc, char **argv)
{
    bool pass = true;

    EGLContext egl_ctx;
    EGLDisplay *dpy = get_egl_display_or_skip();
    const char *extensions = eglQueryString(dpy, EGL_EXTENSIONS);
    char *first_space;
    char *an_extension;

    /* We don't have any extensions guaranteed by the ABI, so for the
     * touch test we just check if the first one is reported to be there.
     */
    first_space = strstr(extensions, " ");
    if (first_space) {
        an_extension = strndup(extensions, first_space - extensions);
    } else {
        an_extension = strdup(extensions);
    }

    if (!epoxy_extension_in_string(extensions, an_extension))
        errx(1, "Implementation reported absence of %s", an_extension);

    free(an_extension);

    init_egl(dpy, &egl_ctx);
    pass = make_egl_current_and_test(dpy, egl_ctx);

    return pass != true;
}
コード例 #2
0
ファイル: dispatch_wgl.c プロジェクト: Acidburn0zzz/libepoxy
PUBLIC bool
epoxy_has_wgl_extension(HDC hdc, const char *ext)
 {
     PFNWGLGETEXTENSIONSSTRINGARBPROC getext;

     getext = (void *)wglGetProcAddress("wglGetExtensionsStringARB");
     if (!getext) {
         fprintf(stderr,
                 "Implementation unexpectedly missing "
                 "WGL_ARB_extensions_string.  Probably a libepoxy bug.\n");
         return false;
     }

    return epoxy_extension_in_string(getext(hdc), ext);
}