summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2011-06-24 13:32:10 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2011-10-05 17:08:40 +0100
commit6bbc0e0f7627e36c8e8940a85499a703529ea8af (patch)
tree4418c29e6d6171711df400db32247705fc9cf51a
parente388cd4d8bc38dd1182cd6d624a773a0ea380b60 (diff)
XWin: GLX: Create a new dispatch table rather than modifying the existing one
When _glapi_create_table_from_handle lands, this should probably be changed to use that.
-rwxr-xr-xhw/xwin/glx/gen_gl_wrappers.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/xwin/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py
index 4b9d17d0f..9cd59d12b 100755
--- a/hw/xwin/glx/gen_gl_wrappers.py
+++ b/hw/xwin/glx/gen_gl_wrappers.py
@@ -313,7 +313,12 @@ for w in sorted(wrappers.keys()) :
if dispatchheader :
print 'void glWinSetupDispatchTable(void)'
print '{'
- print ' struct _glapi_table *disp = _glapi_get_dispatch();'
+ print ' static struct _glapi_table *disp = NULL;'
+ print ''
+ print ' if (disp) { _glapi_get_dispatch(); return; }'
+ print ''
+ print ' disp = calloc(1, sizeof(struct _glapi_table));'
+ print ' assert(disp);'
for d in sorted(dispatch.keys()) :
if wrappers.has_key(d) :
@@ -321,4 +326,7 @@ if dispatchheader :
else :
print '#warning No wrapper for ' + prefix + d + ' !'
+ print ''
+ print ' _glapi_set_dispatch(disp);'
+ print ''
print '}'