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`).
This commit is contained in:
Jelle Raaijmakers 2024-02-13 01:27:24 +01:00
commit 60bd458ed2
Notes: sideshowbarker 2024-07-18 05:01:22 +09:00

View file

@ -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);