X-Git-Url: https://git.cworth.org/git?p=fips;a=blobdiff_plain;f=fips-dispatch.h;h=8938e61fb74501d2710c0f30280e48e653259add;hp=a3717032f84614e165a32d2fa54c8f38552f3edf;hb=6475596e655063624dbf54359bd2a45de6a17dd1;hpb=5569357a9fc7189c2bae43773f44ba576583ec2b diff --git a/fips-dispatch.h b/fips-dispatch.h index a371703..8938e61 100644 --- a/fips-dispatch.h +++ b/fips-dispatch.h @@ -19,33 +19,40 @@ * THE SOFTWARE. */ +/* This header file provides prototypes to iniatialize the + * fips-dispatch system (fips_dispatch_init) but does not provide the + * prototypes for dynamically-dipatched OpenGL functions. + * See fips-dispatch-gl.h for those. + */ + #ifndef FIPS_DISPATCH_H #define FIPS_DISPATCH_H -#define GL_GLEXT_PROTOTYPES -#include - -extern PFNGLGENQUERIESPROC fips_dispatch_glGenQueries; -#define glGenQueries fips_dispatch_glGenQueries - -extern PFNGLDELETEQUERIESPROC fips_dispatch_glDeleteQueries; -#define glDeleteQueries fips_dispatch_glDeleteQueries - -extern PFNGLBEGINQUERYPROC fips_dispatch_glBeginQuery; -#define glBeginQuery fips_dispatch_glBeginQuery - -extern PFNGLENDQUERYPROC fips_dispatch_glEndQuery; -#define glEndQuery fips_dispatch_glEndQuery - -extern PFNGLGETQUERYOBJECTUIVPROC fips_dispatch_glGetQueryObjectuiv; -#define glGetQueryObjectuiv fips_dispatch_glGetQueryObjectuiv +#include "fips.h" typedef enum { FIPS_API_GLX, FIPS_API_EGL } fips_api_t; +extern bool fips_dispatch_initialized; +extern fips_api_t fips_dispatch_api; + +/* Initialize fips-dispatch with the appropriate API, (whether GLX or + * EGL, etc.). */ void fips_dispatch_init (fips_api_t api); +/* Lookup a named symbol, (via either glXGetProcAddressARB or + * eglGetProcAddress). + * + * Note: No user of fips-dispatch need ever call this + * function. Instead, users should simply include fips-dispatch-gl.h, + * then make direct calls to GL functions and through some + * C-preprocessor magic, the lookup will magically happen at + * runtime. + */ +void * +fips_dispatch_lookup (const char *name); + #endif /* FIPS_DISPATCH_H */