if source_ext and source_ext!=backport_ext:
out.write("\tif(is_supported(\"GL_%s\"))\n\t{\n"%(source_ext.name))
for f in funcs:
- s = f
if f.sources:
- s = f.sources[0]
- if target_api in s.supported_apis:
- out.write("\t\t%s = reinterpret_cast<%s>(GET_PROC_ADDRESS(%s));\n"%(f.name, f.typedef, s.name))
+ src = None
+ for s in f.sources:
+ if s.name.endswith(source_ext.ext_type):
+ src = s
+ break
+ if not src:
+ src = f.sources[0]
+ else:
+ src = f
+
+ if target_api in src.supported_apis:
+ if not src.name.endswith(source_ext.ext_type):
+ print "Warning: %s does not match extension type %s"%(src.name, source_ext.ext_type)
+ out.write("\t\t%s = reinterpret_cast<%s>(GET_PROC_ADDRESS(%s));\n"%(f.name, f.typedef, src.name))
out.write("\t\treturn Extension::EXTENSION;\n")
out.write("\t}\n")
out.write("\treturn Extension::UNSUPPORTED;\n")