diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-07-25 16:53:55 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-10-04 17:14:22 +0100 |
commit | ddcb5ac5c50c6462766cafee21e587f05ac0e558 (patch) | |
tree | 28aad2b7d7478d8e7077c14c404ff254c3022b9b | |
parent | aad3b7708eed07413740f5e119dee482dea1751c (diff) |
Add a few more special cases to generated wrappers
-rwxr-xr-x | hw/xwin/gen_gl_wrappers.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/hw/xwin/gen_gl_wrappers.py b/hw/xwin/gen_gl_wrappers.py index aada8baf4..3de370988 100755 --- a/hw/xwin/gen_gl_wrappers.py +++ b/hw/xwin/gen_gl_wrappers.py @@ -38,6 +38,8 @@ import re r1 = re.compile(r'GLAPI\s(.*)\s(?:GL|)APIENTRY\s(\S*)\s?\((.*)\);') r2 = re.compile(r'#define\sSET_(\S*)\(') r3 = re.compile(r'glWindowPos.*MESA') +r4 = re.compile(r'gl.*Program(s|)NV') +r5 = re.compile(r'glGetVertexAttribfvNV') print '/* Automatically generated by ' + sys.argv[0] + ' DO NOT EDIT */' print '' @@ -146,15 +148,30 @@ for line in glextdoth : print 'static ' + returntype + ' ' + funcname + 'Wrapper(' + arglist + ')' print '{' + + stringname = funcname + # # special case: Windows OpenGL implementations are far more likely to have GL_ARB_window_pos than GL_MESA_window_pos, # so arrange for the wrapper to use the ARB strings to find functions... # - stringname = funcname + m2 = r3.search(funcname) if m2 : stringname = stringname.replace('MESA','ARB') +# +# special case: likewise, implementations are more likely to have GL_ARB_vertex_program than GL_NV_vertex_program, +# especially if they are not NV implementations, so arrange for the wrapper to use ARB strings to find functions +# + + m3 = r4.search(funcname) + if m3 : + stringname = stringname.replace('NV','ARB') + m4 = r5.search(funcname) + if m4 : + stringname = stringname.replace('NV','ARB') + if returntype == 'void' : print ' RESOLVE(PFN' + funcname.upper() + 'PROC, "' + stringname + '");' print ' if (glxWinDebugSettings.enableGLcallTrace) ErrorF("'+ funcname + '\\n");' @@ -199,4 +216,4 @@ for d in dispatch.keys() : else : print '#warning No wrapper for gl' + d + '!' -print '}'
\ No newline at end of file +print '}' |