瀏覽代碼

LibGL: Allow function name override in API definitions

Instead of limiting ourselves to the key of the property in the JSON,
allow overriding the function name so we can generate completely
different function signatures with very similar names to other existing
API methods (e.g. `glUniform*` vs `glUniform*v`).
Jelle Raaijmakers 1 年之前
父節點
當前提交
60bd458ed2
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Meta/Lagom/Tools/CodeGenerators/LibGL/GenerateGLAPIWrapper.cpp

+ 1 - 0
Meta/Lagom/Tools/CodeGenerators/LibGL/GenerateGLAPIWrapper.cpp

@@ -304,6 +304,7 @@ Vector<FunctionDefinition> create_function_definitions(ByteString function_name,
     // Create functions for each name and/or variant
     Vector<FunctionDefinition> functions;
 
+    function_name = function_definition.get_byte_string("name"sv).value_or(function_name);
     auto return_type = function_definition.get_byte_string("return_type"sv).value_or("void");
     auto function_implementation = function_definition.get_byte_string("implementation"sv).value_or(function_name.to_snakecase());
     auto function_unimplemented = function_definition.get_bool("unimplemented"sv).value_or(false);