from optparse import OptionParser
import gl_XML
import glX_XML
-from gles_api import es1_api, es2_api
# number of dynamic entries
_match_c_param = re.compile(
'^(?P<type>[\w\s*]+?)(?P<name>\w+)(\[(?P<array>\d+)\])?$')
- def __init__(self, cols, attrs):
+ def __init__(self, cols, attrs, xml_data = None):
self._parse(cols)
self.slot = attrs['slot']
self.hidden = attrs['hidden']
self.alias = attrs['alias']
self.handcode = attrs['handcode']
+ self.xml_data = xml_data
def c_prototype(self):
return '%s %s(%s)' % (self.c_return(), self.name, self.c_params())
params = func.get_parameter_string(name)
cols.extend([p.strip() for p in params.split(',')])
- ent = ABIEntry(cols, attrs)
+ ent = ABIEntry(cols, attrs, func)
entry_dict[ent.name] = ent
entries = entry_dict.values()
self.prefix_warn = 'gl'
def _override_for_api(self, ent):
- ent.hidden = ent.name not in es1_api
+ if ent.xml_data is None:
+ raise Exception('ES2 API printer requires XML input')
+ ent.hidden = ent.name not in \
+ ent.xml_data.entry_points_for_api_version('es1')
ent.handcode = False
def _get_c_header(self):
self.prefix_warn = 'gl'
def _override_for_api(self, ent):
- ent.hidden = ent.name not in es2_api
+ if ent.xml_data is None:
+ raise Exception('ES2 API printer requires XML input')
+ ent.hidden = ent.name not in \
+ ent.xml_data.entry_points_for_api_version('es2')
ent.handcode = False
def _get_c_header(self):