def getHybridInterface(stripAliasedExtCommands=True): # This is a bit awkward, since we have to create a strange hybrid # interface that includes both GL and ES features and extensions. registry = getGLRegistry() glFeatures = registry.getFeatures('gl') esFeatures = registry.getFeatures('gles2') spec = khr_util.registry.InterfaceSpec() for feature in registry.getFeatures('gl'): spec.addFeature(feature, 'gl', 'core') for feature in registry.getFeatures('gles2'): spec.addFeature(feature, 'gles2') for extName in EXTENSIONS: extension = registry.extensions[extName] # Add all extensions using the ES2 api, but force even non-ES2 # extensions to be included. spec.addExtension(extension, 'gles2', 'core', force=True) iface = khr_util.registry.createInterface(registry, spec, 'gles2') if stripAliasedExtCommands: # Remove redundant extension commands that are already provided by core. strippedCmds = [] for command in iface.commands: if command.alias == None: strippedCmds.append(command) iface.commands = strippedCmds return iface
def getHybridInterface (stripAliasedExtCommands = True): # This is a bit awkward, since we have to create a strange hybrid # interface that includes both GL and ES features and extensions. registry = getGLRegistry() glFeatures = registry.getFeatures('gl') esFeatures = registry.getFeatures('gles2') spec = khr_util.registry.InterfaceSpec() for feature in registry.getFeatures('gl'): spec.addFeature(feature, 'gl', 'core') for feature in registry.getFeatures('gles2'): spec.addFeature(feature, 'gles2') for extName in EXTENSIONS: extension = registry.extensions[extName] # Add all extensions using the ES2 api, but force even non-ES2 # extensions to be included. spec.addExtension(extension, 'gles2', 'core', force=True) iface = khr_util.registry.createInterface(registry, spec, 'gles2') if stripAliasedExtCommands: # Remove redundant extension commands that are already provided by core. strippedCmds = [] for command in iface.commands: if command.alias == None: strippedCmds.append(command) iface.commands = strippedCmds return iface
def getHybridInterface (): # This is a bit awkward, since we have to create a strange hybrid # interface that includes both GL and ES features and extensions. registry = getGLRegistry() glFeatures = registry.getFeatures('gl') esFeatures = registry.getFeatures('gles2') spec = khr_util.registry.InterfaceSpec() for feature in registry.getFeatures('gl'): spec.addFeature(feature, 'gl', 'core') for feature in registry.getFeatures('gles2'): spec.addFeature(feature, 'gles2') for extName in EXTENSIONS: extension = registry.extensions[extName] # Add all extensions using the ES2 api, but force even non-ES2 # extensions to be included. spec.addExtension(extension, 'gles2', 'core', force=True) # Remove redundant extension commands that are already provided by core. for commandName in list(spec.commands): coreName = getCoreName(commandName) if coreName != commandName and coreName in spec.commands: spec.commands.remove(commandName) return khr_util.registry.createInterface(registry, spec, 'gles2')
def getInterfaceExactVersion (registry, api, version): spec = khr_util.registry.InterfaceSpec() def check (v): return v == version for feature in registry.getFeatures(api, check): spec.addFeature(feature, api) return khr_util.registry.createInterface(registry, spec, api)