Allow passing null pointers to more rlgl functions (#128)

This commit is contained in:
Not-Nik 2024-08-04 23:25:47 +02:00
parent a7f25c615b
commit da1da5a66c
Failed to generate hash of commit
3 changed files with 22 additions and 13 deletions

View file

@ -289,14 +289,23 @@ def parse_header(header_name: str, output_file: str, ext_file: str, prefix: str,
single_opt = [
("rlDrawVertexArrayElements", "buffer"),
("rlDrawVertexArrayElementsInstanced", "buffer")
("rlDrawVertexArrayElementsInstanced", "buffer"),
("rlEnableStatePointer", "buffer"),
("rlSetRenderBatchActive", "batch"),
("rlLoadTexture", "data"),
("rlLoadTextureCubemap", "data"),
("rlLoadShaderBuffer", "data"),
("rlLoadShaderCode", "vsCode"),
("rlLoadShaderCode", "fsCode"),
]
if arg_type.startswith("*") and (func_name, arg_name) in single_opt:
arg_type = "?" + arg_type
zig_type = ziggify_type(arg_name, arg_type, func_name)
if zig_type.startswith("*") and (func_name, arg_name) in single_opt:
if not arg_type.startswith("[*c]"):
arg_type = "?" + arg_type
zig_type = "?" + zig_type
zig_types.add(arg_type)
zig_c_arguments.append(arg_name + ": " + add_namespace_to_type(arg_type)) # Put everything together.
zig_arguments.append(arg_name + ": " + zig_type)