diff options
author | Robert Bragg <robert@linux.intel.com> | 2011-02-25 11:29:08 +0000 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-05-05 14:46:01 +0100 |
commit | dc7383b7148abe4bd0736042aafe3981e8313b31 (patch) | |
tree | e6d1ab3a1aa50e85c494274e81181f7710784e9b /cogl/cogl.c | |
parent | d52e3f0cc2360febbbebf70262d2cf65dd46a8f3 (diff) | |
download | cogl-dc7383b7148abe4bd0736042aafe3981e8313b31.tar.gz |
Add a vtable of indirection to the winsys code
So that we can dynamically select what winsys backend to use at runtime
we need to have some indirection to how code accesses the winsys instead
of simply calling _cogl_winsys* functions that would collide if we
wanted to compile more than one backend into Cogl.
Diffstat (limited to 'cogl/cogl.c')
-rw-r--r-- | cogl/cogl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cogl/cogl.c b/cogl/cogl.c index 4dbe4aeb..69ed6524 100644 --- a/cogl/cogl.c +++ b/cogl/cogl.c @@ -93,8 +93,17 @@ cogl_get_proc_address (const char* name) { void *address; static GModule *module = NULL; +#ifdef COGL_HAS_FULL_WINSYS + const CoglWinsysVtable *winsys; + _COGL_GET_CONTEXT (ctx, NULL); + + winsys = _cogl_context_get_winsys (ctx); + + address = winsys->get_proc_address (name); +#else address = _cogl_winsys_get_proc_address (name); +#endif if (address) return address; |