diff options
author | Ian Romanick <[email protected]> | 2005-01-25 23:53:13 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2005-01-25 23:53:13 +0000 |
commit | 38e6e09cb86ef0bfea87a907def49f00af67fd8f (patch) | |
tree | b110fa4835b5d389af81a5706f487164a510e69d /src/mesa/glapi/gl_procs.py | |
parent | e4d41524a229aa1e0788668b28151125b9c6581e (diff) |
Add a glFunctionIterator class to iterate over the functions stored in a
higher-level API object. Use this type of object to implement the
printFunctions method. Modify other functions that iterate over the list of
functions to use this type of object.
Diffstat (limited to 'src/mesa/glapi/gl_procs.py')
-rw-r--r-- | src/mesa/glapi/gl_procs.py | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/src/mesa/glapi/gl_procs.py b/src/mesa/glapi/gl_procs.py index f9ce8e2da1b..a9fdd1812c1 100644 --- a/src/mesa/glapi/gl_procs.py +++ b/src/mesa/glapi/gl_procs.py @@ -91,16 +91,8 @@ class PrintGlProcs(gl_XML.FilterGLAPISpecBase): else: print 'static const char gl_string_table[] = {' - keys = self.functions.keys() - keys.sort() - for k in keys: - if k < 0: continue - self.printFunctionString(self.functions[k]) - - keys.reverse() - for k in keys: - if k >= -1: continue - self.printFunctionString(self.functions[k]) + for f in self.functionIterator(): + self.printFunctionString(f) if self.long_strings: print ' ;' @@ -110,27 +102,15 @@ class PrintGlProcs(gl_XML.FilterGLAPISpecBase): print '' print 'static const glprocs_table_t static_functions[] = {' - keys = self.functions.keys() - keys.sort() base_offset = 0 - for k in keys: - if k < 0: continue - self.printFunctionOffset(self.functions[k], base_offset) - - # The length of the function's name, plus 2 for "gl", - # plus 1 for the NUL. - - base_offset += len(self.functions[k].name) + 3 - keys.reverse() - for k in keys: - if k >= -1: continue - self.printFunctionOffset(self.functions[k], base_offset) + for f in self.functionIterator(): + self.printFunctionOffset(f, base_offset) # The length of the function's name, plus 2 for "gl", # plus 1 for the NUL. - base_offset += len(self.functions[k].name) + 3 + base_offset += len(f.name) + 3 print ' NAME_FUNC_OFFSET( -1, NULL, 0 )' print '};' |