From 76ad89fe0b8c0fc4a1843bbe4a0d5def0e52af67 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Fri, 2 Sep 2022 21:32:38 -0500 Subject: [PATCH] Generate constants in the bindings generator --- binding_generator.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/binding_generator.py b/binding_generator.py index d2f801f5..3cf4ae57 100644 --- a/binding_generator.py +++ b/binding_generator.py @@ -1005,6 +1005,13 @@ def generate_engine_class_header(class_api, used_classes, fully_used_classes, us result.append("\t};") result.append("") + if "constants" in class_api: + for value in class_api["constants"]: + if "type" not in value: + value["type"] = "int" + result.append(f'\tconst {value["type"]} {value["name"]} = {value["value"]};') + result.append("") + if is_singleton: result.append(f"\tstatic {class_name} *get_singleton();") result.append("")