Allow passing points for drawing as const slices (#127)

This commit is contained in:
Not-Nik 2024-08-04 23:33:48 +02:00
parent da1da5a66c
commit 6cc4aec3c4
Failed to generate hash of commit
3 changed files with 36 additions and 30 deletions

View file

@ -34,6 +34,9 @@ IGNORE_TYPES = [
"[*c]ModelAnimation",
"[*c]f32",
]
MAKE_CONST = [
"points"
]
# Some C types have a different sizes on different systems and Zig
# knows that so we tell it to get the system specific size for us.
def c_to_zig_type(c: str) -> str:
@ -140,6 +143,9 @@ def fix_pointer(name: str, t: str):
while name.startswith("*"):
name = name[1:]
pre += "[*c]"
if name in MAKE_CONST:
pre += "const "
t = pre + t
if t == "[*c]const void":