# Authors:
# Ian Romanick <idr@us.ibm.com>
-import gl_XML, license
+import license
+import gl_XML, glX_XML
import sys, getopt, copy
def should_use_push(registers):
print ''
print '# if defined(USE_MGL_NAMESPACE)'
print '# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))'
+ print '# define _glapi_Dispatch _mglapi_Dispatch'
print '# else'
print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))'
print '# endif'
print ''
- print '#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
+ print '#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
print '# define THREADS'
print '#endif'
print ''
for n in f.entry_points:
if n != f.name:
if f.is_static_entry_point(n):
- print '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch)
+ text = '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch)
+
+ if f.has_different_protocol(n):
+ print '#ifndef GLX_INDIRECT_RENDERING'
+ print text
+ print '#endif'
+ else:
+ print text
return
print "ERROR: Invalid mode \"%s\" specified." % mode
show_usage()
- api = gl_XML.parse_GL_API( file_name )
-
- printer.Print( api )
+ api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory())
+ printer.Print(api)