1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

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
parent eb4632e08a
commit 60bd458ed2

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