OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """code generator for GL/GLES extension wrangler.""" | 6 """code generator for GL/GLES extension wrangler.""" |
7 | 7 |
8 import os | 8 import os |
9 import collections | 9 import collections |
10 import re | 10 import re |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1138 | 1138 |
1139 // This file is automatically generated. | 1139 // This file is automatically generated. |
1140 | 1140 |
1141 #ifndef UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_ | 1141 #ifndef UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_ |
1142 #define UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_ | 1142 #define UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_ |
1143 | 1143 |
1144 namespace gfx { | 1144 namespace gfx { |
1145 | 1145 |
1146 class GLContext; | 1146 class GLContext; |
1147 | 1147 |
1148 void InitializeGLBindings%(name)s(); | |
1149 void InitializeGLExtensionBindings%(name)s(GLContext* context); | |
1150 void InitializeDebugGLBindings%(name)s(); | |
1151 void ClearGLBindings%(name)s(); | |
1152 """ % {'name': set_name.upper()}) | 1148 """ % {'name': set_name.upper()}) |
1153 | 1149 |
1154 # Write typedefs for function pointer types. Always use the GL name for the | 1150 # Write typedefs for function pointer types. Always use the GL name for the |
1155 # typedef. | 1151 # typedef. |
1156 file.write('\n') | 1152 file.write('\n') |
1157 for func in functions: | 1153 for func in functions: |
1158 file.write('typedef %s (GL_BINDING_CALL *%sProc)(%s);\n' % | 1154 file.write('typedef %s (GL_BINDING_CALL *%sProc)(%s);\n' % |
1159 (func['return_type'], func['names'][0], func['arguments'])) | 1155 (func['return_type'], func['names'][0], func['arguments'])) |
1160 | 1156 |
1161 # Write declarations for booleans indicating which extensions are available. | 1157 # Write declarations for booleans indicating which extensions are available. |
1162 file.write('\n') | 1158 file.write('\n') |
1159 file.write("struct Extensions%s {\n" % set_name.upper()) | |
1163 for extension, ext_functions in used_extension_functions: | 1160 for extension, ext_functions in used_extension_functions: |
1164 file.write('GL_EXPORT extern bool g_%s;\n' % extension) | 1161 file.write(' bool b_%s;\n' % extension) |
1162 file.write('};\n') | |
1163 file.write('\n') | |
1165 | 1164 |
1166 # Write declarations for function pointers. Always use the GL name for the | 1165 # # Write declarations for function pointers. Always use the GL name for the |
1167 # declaration. | 1166 # # declaration. |
1167 # file.write('\n') | |
apatrick_chromium
2012/10/24 23:09:12
Commented out
| |
1168 # for func in functions: | |
1169 # file.write('GL_EXPORT extern %sProc g_%s;\n' % | |
1170 # (func['names'][0], func['names'][0])) | |
1171 # file.write('\n') | |
1172 | |
1173 # Write Procs struct. | |
1174 file.write("struct Procs%s {\n" % set_name.upper()) | |
1175 for func in functions: | |
1176 file.write(' %sProc %sFn;\n' % (func['names'][0], func['names'][0])) | |
1177 file.write('};\n') | |
1168 file.write('\n') | 1178 file.write('\n') |
1179 | |
1180 # Write Driver struct. | |
1181 file.write( | |
1182 """struct GL_EXPORT Driver%(name)s { | |
1183 void InitializeBindings(); | |
1184 void InitializeExtensionBindings(GLContext* context); | |
1185 void InitializeDebugBindings(); | |
1186 void ClearBindings(); | |
1187 void UpdateDebugExtensionBindings(); | |
1188 | |
1189 Procs%(name)s fn; | |
1190 Procs%(name)s debug_fn; | |
1191 Extensions%(name)s ext; | |
1192 """ % {'name': set_name.upper()}) | |
1193 file.write('};\n') | |
1194 file.write('\n') | |
1195 | |
1196 # Write Api class. | |
1197 file.write( | |
1198 """class GL_EXPORT %(name)sApi { | |
1199 public: | |
1200 %(name)sApi(); | |
1201 virtual ~%(name)sApi(); | |
1202 | |
1203 """ % {'name': set_name.upper()}) | |
1169 for func in functions: | 1204 for func in functions: |
1170 file.write('GL_EXPORT extern %sProc g_%s;\n' % | 1205 file.write(' virtual %s %sFn(%s) = 0;\n' % |
1171 (func['names'][0], func['names'][0])) | 1206 (func['return_type'], func['names'][0], func['arguments'])) |
1207 file.write('};\n') | |
1172 file.write('\n') | 1208 file.write('\n') |
1209 | |
1173 file.write( '} // namespace gfx\n') | 1210 file.write( '} // namespace gfx\n') |
1174 | 1211 |
1175 # Write macros to invoke function pointers. Always use the GL name for the | 1212 # Write macros to invoke function pointers. Always use the GL name for the |
1176 # macro. | 1213 # macro. |
1177 file.write('\n') | 1214 file.write('\n') |
1178 for func in functions: | 1215 for func in functions: |
1179 file.write('#define %s ::gfx::g_%s\n' % | 1216 file.write('#define %s ::gfx::g_current_%s_context->%sFn\n' % |
1180 (func['names'][0], func['names'][0])) | 1217 (func['names'][0], set_name.lower(), func['names'][0])) |
1181 | 1218 |
1182 file.write('\n') | 1219 file.write('\n') |
1183 file.write('#endif // UI_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' % | 1220 file.write('#endif // UI_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' % |
1184 set_name.upper()) | 1221 set_name.upper()) |
1185 | 1222 |
1186 | 1223 |
1224 def GenerateAPIHeader(file, functions, set_name, used_extension_functions): | |
1225 """Generates gl_binding_api_autogen_x.h""" | |
1226 | |
1227 # Write file header. | |
1228 file.write( | |
1229 """// Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
1230 // Use of this source code is governed by a BSD-style license that can be | |
1231 // found in the LICENSE file. | |
1232 | |
1233 // This file is automatically generated. | |
1234 | |
1235 #ifndef UI_GFX_GL_GL_BINDINGS_API_AUTOGEN_%(name)s_H_ | |
1236 #define UI_GFX_GL_GL_BINDINGS_API_AUTOGEN_%(name)s_H_ | |
1237 | |
1238 """ % {'name': set_name.upper()}) | |
1239 | |
1240 # Write API declaration. | |
1241 for func in functions: | |
1242 file.write(' virtual %s %sFn(%s) OVERRIDE;\n' % | |
1243 (func['return_type'], func['names'][0], func['arguments'])) | |
1244 | |
1245 file.write('\n') | |
1246 file.write('#endif // UI_GFX_GL_GL_BINDINGS_API_AUTOGEN_%s_H_\n' % | |
1247 set_name.upper()) | |
1248 | |
1249 | |
1187 def GenerateSource(file, functions, set_name, used_extension_functions): | 1250 def GenerateSource(file, functions, set_name, used_extension_functions): |
1188 """Generates gl_binding_autogen_x.cc""" | 1251 """Generates gl_binding_autogen_x.cc""" |
1189 | 1252 |
1190 # Write file header. | 1253 # Write file header. |
1191 file.write( | 1254 file.write( |
1192 """// Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1255 """// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
1193 // Use of this source code is governed by a BSD-style license that can be | 1256 // Use of this source code is governed by a BSD-style license that can be |
1194 // found in the LICENSE file. | 1257 // found in the LICENSE file. |
1195 | 1258 |
1196 // This file is automatically generated. | 1259 // This file is automatically generated. |
1197 | 1260 |
1198 #include <string> | 1261 #include <string> |
1199 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 1262 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
1200 #include "ui/gl/gl_bindings.h" | 1263 #include "ui/gl/gl_bindings.h" |
1201 #include "ui/gl/gl_context.h" | 1264 #include "ui/gl/gl_context.h" |
1202 #include "ui/gl/gl_implementation.h" | 1265 #include "ui/gl/gl_implementation.h" |
1266 #include "ui/gl/gl_%s_api_implementation.h" | |
1203 | 1267 |
1204 using gpu::gles2::GLES2Util; | 1268 using gpu::gles2::GLES2Util; |
1205 | 1269 |
1206 namespace gfx { | 1270 namespace gfx { |
1207 """) | 1271 """ % set_name.lower()) |
1208 # Write definitions for booleans indicating which extensions are available. | 1272 # # Write definitions for booleans indicating which extensions are available. |
1209 for extension, ext_functions in used_extension_functions: | 1273 # for extension, ext_functions in used_extension_functions: |
apatrick_chromium
2012/10/24 23:09:12
Commented out
| |
1210 file.write('bool g_%s;\n' % extension) | 1274 # file.write('bool g_%s;\n' % extension) |
1211 | 1275 |
1212 # Write definitions of function pointers. | 1276 # Write definitions of function pointers. |
1213 file.write('\n') | 1277 file.write('\n') |
1214 file.write('static bool g_debugBindingsInitialized;\n') | 1278 file.write('static bool g_debugBindingsInitialized;\n') |
1215 file.write('static void UpdateDebugGLExtensionBindings();\n') | 1279 file.write('Driver%s g_driver_%s;\n' % (set_name.upper(), set_name.lower())) |
1216 file.write('\n') | 1280 file.write('\n') |
1217 for func in functions: | 1281 # for func in functions: |
apatrick_chromium
2012/10/24 23:09:12
And here!
| |
1218 file.write('%sProc g_%s;\n' % (func['names'][0], func['names'][0])) | 1282 # file.write('%sProc g_%s;\n' % (func['names'][0], func['names'][0])) |
1219 | |
1220 file.write('\n') | |
1221 for func in functions: | |
1222 file.write('static %sProc g_debug_%s;\n' % | |
1223 (func['names'][0], func['names'][0])) | |
1224 | 1283 |
1225 # Write function to initialize the core function pointers. The code assumes | 1284 # Write function to initialize the core function pointers. The code assumes |
1226 # any non-NULL pointer returned by GetGLCoreProcAddress() is valid, although | 1285 # any non-NULL pointer returned by GetGLCoreProcAddress() is valid, although |
1227 # it may be overwritten by an extension function pointer later. | 1286 # it may be overwritten by an extension function pointer later. |
1228 file.write('\n') | 1287 file.write('\n') |
1229 file.write('void InitializeGLBindings%s() {\n' % set_name.upper()) | 1288 file.write('void Driver%s::InitializeBindings() {\n' % |
1289 set_name.upper()) | |
1230 for func in functions: | 1290 for func in functions: |
1231 first_name = func['names'][0] | 1291 first_name = func['names'][0] |
1232 for i, name in enumerate(func['names']): | 1292 for i, name in enumerate(func['names']): |
1233 if i: | 1293 if i: |
1234 file.write(' if (!g_%s)\n ' % first_name) | 1294 file.write(' if (!fn.%sFn)\n ' % first_name) |
1235 file.write( | 1295 file.write( |
1236 ' g_%s = reinterpret_cast<%sProc>(GetGLCoreProcAddress("%s"));\n' % | 1296 ' fn.%sFn = reinterpret_cast<%sProc>(' |
1237 (first_name, first_name, name)) | 1297 'GetGLCoreProcAddress("%s"));\n' % |
1298 (first_name, first_name, name)) | |
1238 file.write('}\n') | 1299 file.write('}\n') |
1239 file.write('\n') | 1300 file.write('\n') |
1240 | 1301 |
1241 # Write function to initialize the extension function pointers. This function | 1302 # Write function to initialize the extension function pointers. This function |
1242 # uses a current context to query which extensions are actually supported. | 1303 # uses a current context to query which extensions are actually supported. |
1243 file.write('void InitializeGLExtensionBindings%s(GLContext* context) {\n' % | 1304 file.write("""void Driver%s::InitializeExtensionBindings( |
1244 set_name.upper()) | 1305 GLContext* context) { |
1306 """ % set_name.upper()) | |
1245 file.write(' DCHECK(context && context->IsCurrent(NULL));\n') | 1307 file.write(' DCHECK(context && context->IsCurrent(NULL));\n') |
1246 for extension, ext_functions in used_extension_functions: | 1308 for extension, ext_functions in used_extension_functions: |
1247 file.write(' g_%s = context->HasExtension("%s");\n' % | 1309 file.write(' ext.b_%s = context->HasExtension("%s");\n' % |
1248 (extension, extension)) | 1310 (extension, extension)) |
1249 file.write(' if (g_%s) {\n' % | 1311 file.write(' if (ext.b_%s) {\n' % |
1250 (extension)) | 1312 (extension)) |
1251 queried_entry_points = set() | 1313 queried_entry_points = set() |
1252 for entry_point_name, function_name in ext_functions: | 1314 for entry_point_name, function_name in ext_functions: |
1253 # Replace the pointer unconditionally unless this extension has several | 1315 # Replace the pointer unconditionally unless this extension has several |
1254 # alternatives for the same entry point (e.g., | 1316 # alternatives for the same entry point (e.g., |
1255 # GL_ARB_blend_func_extended). | 1317 # GL_ARB_blend_func_extended). |
1256 if entry_point_name in queried_entry_points: | 1318 if entry_point_name in queried_entry_points: |
1257 file.write(' if (!g_%s)\n ' % entry_point_name) | 1319 file.write(' if (!fn.%sFn)\n ' % entry_point_name) |
1258 file.write( | 1320 file.write( |
1259 ' g_%s = reinterpret_cast<%sProc>(GetGLProcAddress("%s"));\n' % | 1321 ' fn.%sFn = reinterpret_cast<%sProc>(GetGLProcAddress("%s"));\n' % |
1260 (entry_point_name, entry_point_name, function_name)) | 1322 (entry_point_name, entry_point_name, function_name)) |
1261 queried_entry_points.add(entry_point_name) | 1323 queried_entry_points.add(entry_point_name) |
1262 file.write(' }\n') | 1324 file.write(' }\n') |
1263 file.write(' if (g_debugBindingsInitialized)\n') | 1325 file.write(' if (g_debugBindingsInitialized)\n') |
1264 file.write(' UpdateDebugGLExtensionBindings();\n') | 1326 file.write(' UpdateDebugExtensionBindings();\n') |
1265 file.write('}\n') | 1327 file.write('}\n') |
1266 file.write('\n') | 1328 file.write('\n') |
1267 | 1329 |
1268 # Write logging wrappers for each function. | 1330 # Write logging wrappers for each function. |
1269 file.write('extern "C" {\n') | 1331 file.write('extern "C" {\n') |
1270 for func in functions: | 1332 for func in functions: |
1271 names = func['names'] | 1333 names = func['names'] |
1272 return_type = func['return_type'] | 1334 return_type = func['return_type'] |
1273 arguments = func['arguments'] | 1335 arguments = func['arguments'] |
1274 file.write('\n') | 1336 file.write('\n') |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1307 log_argument_names = log_argument_names.replace(',', ' << ", " <<') | 1369 log_argument_names = log_argument_names.replace(',', ' << ", " <<') |
1308 if argument_names == 'void' or argument_names == '': | 1370 if argument_names == 'void' or argument_names == '': |
1309 argument_names = '' | 1371 argument_names = '' |
1310 log_argument_names = '' | 1372 log_argument_names = '' |
1311 else: | 1373 else: |
1312 log_argument_names = " << " + log_argument_names | 1374 log_argument_names = " << " + log_argument_names |
1313 function_name = names[0] | 1375 function_name = names[0] |
1314 if return_type == 'void': | 1376 if return_type == 'void': |
1315 file.write(' GL_SERVICE_LOG("%s" << "(" %s << ")");\n' % | 1377 file.write(' GL_SERVICE_LOG("%s" << "(" %s << ")");\n' % |
1316 (function_name, log_argument_names)) | 1378 (function_name, log_argument_names)) |
1317 file.write(' g_debug_%s(%s);\n' % | 1379 file.write(' g_driver_%s.debug_fn.%sFn(%s);\n' % |
1318 (function_name, argument_names)) | 1380 (set_name.lower(), function_name, argument_names)) |
1319 if 'logging_code' in func: | 1381 if 'logging_code' in func: |
1320 file.write("%s\n" % func['logging_code']) | 1382 file.write("%s\n" % func['logging_code']) |
1321 else: | 1383 else: |
1322 file.write(' GL_SERVICE_LOG("%s" << "(" %s << ")");\n' % | 1384 file.write(' GL_SERVICE_LOG("%s" << "(" %s << ")");\n' % |
1323 (function_name, log_argument_names)) | 1385 (function_name, log_argument_names)) |
1324 file.write(' %s result = g_debug_%s(%s);\n' % | 1386 file.write(' %s result = g_driver_%s.debug_fn.%sFn(%s);\n' % |
1325 (return_type, function_name, argument_names)) | 1387 (return_type, set_name.lower(), function_name, argument_names)) |
1326 if 'logging_code' in func: | 1388 if 'logging_code' in func: |
1327 file.write("%s\n" % func['logging_code']) | 1389 file.write("%s\n" % func['logging_code']) |
1328 else: | 1390 else: |
1329 file.write(' GL_SERVICE_LOG("GL_RESULT: " << result);\n'); | 1391 file.write(' GL_SERVICE_LOG("GL_RESULT: " << result);\n'); |
1330 file.write(' return result;\n') | 1392 file.write(' return result;\n') |
1331 file.write('}\n') | 1393 file.write('}\n') |
1332 file.write('} // extern "C"\n') | 1394 file.write('} // extern "C"\n') |
1333 | 1395 |
1334 # Write function to initialize the debug function pointers. | 1396 # Write function to initialize the debug function pointers. |
1335 file.write('\n') | 1397 file.write('\n') |
1336 file.write('void InitializeDebugGLBindings%s() {\n' % set_name.upper()) | 1398 file.write('void Driver%s::InitializeDebugBindings() {\n' % |
1399 set_name.upper()) | |
1337 for func in functions: | 1400 for func in functions: |
1338 first_name = func['names'][0] | 1401 first_name = func['names'][0] |
1339 file.write(' if (!g_debug_%s) {\n' % first_name) | 1402 file.write(' if (!debug_fn.%sFn) {\n' % first_name) |
1340 file.write(' g_debug_%s = g_%s;\n' % (first_name, first_name)) | 1403 file.write(' debug_fn.%sFn = fn.%sFn;\n' % (first_name, first_name)) |
1341 file.write(' g_%s = Debug_%s;\n' % (first_name, first_name)) | 1404 file.write(' fn.%sFn = Debug_%s;\n' % (first_name, first_name)) |
1342 file.write(' }\n') | 1405 file.write(' }\n') |
1343 file.write(' g_debugBindingsInitialized = true;\n') | 1406 file.write(' g_debugBindingsInitialized = true;\n') |
1344 file.write('}\n') | 1407 file.write('}\n') |
1345 | 1408 |
1346 # Write function to update the debug function pointers to extension functions | 1409 # Write function to update the debug function pointers to extension functions |
1347 # after the extensions have been initialized. | 1410 # after the extensions have been initialized. |
1348 file.write('\n') | 1411 file.write('\n') |
1349 file.write('static void UpdateDebugGLExtensionBindings() {\n') | 1412 file.write('void Driver%s::UpdateDebugExtensionBindings() {\n' % |
1413 set_name.upper()) | |
1350 for extension, ext_functions in used_extension_functions: | 1414 for extension, ext_functions in used_extension_functions: |
1351 for name, _ in ext_functions: | 1415 for name, _ in ext_functions: |
1352 file.write(' if (g_debug_%s != g_%s &&\n' % (name, name)) | 1416 file.write(' if (debug_fn.%sFn != fn.%sFn &&\n' % (name, name)) |
1353 file.write(' g_%s != Debug_%s) {\n' % (name, name)) | 1417 file.write(' fn.%sFn != Debug_%s) {\n' % (name, name)) |
1354 file.write(' g_debug_%s = g_%s;\n' % (name, name)) | 1418 file.write(' debug_fn.%sFn = fn.%sFn;\n' % (name, name)) |
1355 file.write(' g_%s = Debug_%s;\n' % (name, name)) | 1419 file.write(' fn.%sFn = Debug_%s;\n' % (name, name)) |
1356 file.write(' }\n') | 1420 file.write(' }\n') |
1357 file.write('}\n') | 1421 file.write('}\n') |
1358 | 1422 |
1359 # Write function to clear all function pointers. | 1423 # Write function to clear all function pointers. |
1360 file.write('\n') | 1424 file.write('\n') |
1361 file.write('void ClearGLBindings%s() {\n' % set_name.upper()) | 1425 file.write("""void Driver%s::ClearBindings() { |
1362 # Clear the availability of GL extensions. | 1426 memset(this, 0, sizeof(*this)); |
1363 for extension, ext_functions in used_extension_functions: | 1427 } |
1364 file.write(' g_%s = false;\n' % extension) | 1428 """ % set_name.upper()) |
1365 # Clear GL bindings. | 1429 |
1366 file.write('\n') | 1430 # Write RealGLApi functions |
1367 for func in functions: | 1431 for func in functions: |
1368 file.write(' g_%s = NULL;\n' % func['names'][0]) | 1432 names = func['names'] |
1369 # Clear debug GL bindings. | 1433 return_type = func['return_type'] |
1370 file.write('\n') | 1434 arguments = func['arguments'] |
1371 for func in functions: | 1435 file.write('\n') |
1372 file.write(' g_debug_%s = NULL;\n' % func['names'][0]) | 1436 file.write('%s Real%sApi::%sFn(%s) {\n' % |
1373 file.write(' g_debugBindingsInitialized = false;\n') | 1437 (return_type, set_name.upper(), names[0], arguments)) |
1374 file.write('}\n') | 1438 argument_names = re.sub( |
1439 r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2', arguments) | |
1440 argument_names = re.sub( | |
1441 r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2', argument_names) | |
1442 if argument_names == 'void' or argument_names == '': | |
1443 argument_names = '' | |
1444 function_name = names[0] | |
1445 if return_type == 'void': | |
1446 file.write(' driver_->fn.%sFn(%s);\n' % | |
1447 (function_name, argument_names)) | |
1448 else: | |
1449 file.write(' return driver_->fn.%sFn(%s);\n' % | |
1450 (function_name, argument_names)) | |
1451 file.write('}\n') | |
1375 | 1452 |
1376 file.write('\n') | 1453 file.write('\n') |
1377 file.write('} // namespace gfx\n') | 1454 file.write('} // namespace gfx\n') |
1378 | 1455 |
1379 | 1456 |
1380 def GenerateMockSource(file, functions): | 1457 def GenerateMockSource(file, functions): |
1381 """Generates functions that invoke a mock GLInterface""" | 1458 """Generates functions that invoke a mock GLInterface""" |
1382 | 1459 |
1383 file.write( | 1460 file.write( |
1384 """// Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1461 """// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1565 | 1642 |
1566 for [functions, set_name, extension_headers, extensions] in FUNCTION_SETS: | 1643 for [functions, set_name, extension_headers, extensions] in FUNCTION_SETS: |
1567 used_extension_functions = GetUsedExtensionFunctions( | 1644 used_extension_functions = GetUsedExtensionFunctions( |
1568 functions, extension_headers, extensions) | 1645 functions, extension_headers, extensions) |
1569 | 1646 |
1570 header_file = open( | 1647 header_file = open( |
1571 os.path.join(dir, 'gl_bindings_autogen_%s.h' % set_name), 'wb') | 1648 os.path.join(dir, 'gl_bindings_autogen_%s.h' % set_name), 'wb') |
1572 GenerateHeader(header_file, functions, set_name, used_extension_functions) | 1649 GenerateHeader(header_file, functions, set_name, used_extension_functions) |
1573 header_file.close() | 1650 header_file.close() |
1574 | 1651 |
1652 header_file = open( | |
1653 os.path.join(dir, 'gl_bindings_api_autogen_%s.h' % set_name), 'wb') | |
1654 GenerateAPIHeader( | |
1655 header_file, functions, set_name, used_extension_functions) | |
1656 header_file.close() | |
1657 | |
1575 source_file = open( | 1658 source_file = open( |
1576 os.path.join(dir, 'gl_bindings_autogen_%s.cc' % set_name), 'wb') | 1659 os.path.join(dir, 'gl_bindings_autogen_%s.cc' % set_name), 'wb') |
1577 GenerateSource(source_file, functions, set_name, used_extension_functions) | 1660 GenerateSource(source_file, functions, set_name, used_extension_functions) |
1578 source_file.close() | 1661 source_file.close() |
1579 | 1662 |
1580 source_file = open(os.path.join(dir, 'gl_bindings_autogen_mock.cc'), 'wb') | 1663 source_file = open(os.path.join(dir, 'gl_bindings_autogen_mock.cc'), 'wb') |
1581 GenerateMockSource(source_file, GL_FUNCTIONS) | 1664 GenerateMockSource(source_file, GL_FUNCTIONS) |
1582 source_file.close() | 1665 source_file.close() |
1583 return 0 | 1666 return 0 |
1584 | 1667 |
1585 | 1668 |
1586 if __name__ == '__main__': | 1669 if __name__ == '__main__': |
1587 sys.exit(main(sys.argv[1:])) | 1670 sys.exit(main(sys.argv[1:])) |
OLD | NEW |