1 # -*- coding: utf-8 -*-
5 def genExtensions (registry, iface, api):
6 for extName in EXTENSIONS:
7 extIface = getInterface(registry, api, version=False, profile='core', extensionNames=[extName])
8 if not extIface.commands:
12 yield "if (de::contains(extSet, \"%s\"))" % extName
15 def genInit (command):
16 coreName = getCoreName(command.name)
17 ifaceName = coreName if coreName in iface.commands else command.name
18 return "gl->%s\t= (%s)\tloader->get(\"%s\");" % (
19 getFunctionMemberName(ifaceName),
20 getFunctionTypeName(ifaceName),
23 for line in indentLines(genInit(command) for command in extIface.commands):
28 def genExtInit (registry, iface):
29 writeInlFile(os.path.join(OPENGL_INC_DIR, "glwInitExtES.inl"), genExtensions(registry, iface, 'gles2'))
30 writeInlFile(os.path.join(OPENGL_INC_DIR, "glwInitExtGL.inl"), genExtensions(registry, iface, 'gl'))
32 if __name__ == '__main__':
33 genExtInit(getGLRegistry(), getHybridInterface())