30 lines
747 B
Python
30 lines
747 B
Python
import os
|
|
from sys import argv
|
|
|
|
sc_dir = os.path.dirname(os.path.realpath(argv[0]))
|
|
os.chdir(sc_dir)
|
|
|
|
hg_tag = "PLTF_GL_FUNC_ALIAS_H_"
|
|
|
|
lines: list[str] = [
|
|
f"#ifndef {hg_tag}\n",
|
|
f"#define {hg_tag}\n"
|
|
]
|
|
|
|
with open("./src/pltf/internal/gl_func_decl.h", "r") as f:
|
|
header = f.readlines()
|
|
for h_line in header:
|
|
h_split = h_line.split(" ")
|
|
for token in h_split:
|
|
if token[0] == "g" and token[1] == "l":
|
|
token = token.removesuffix(");")
|
|
line = f"#define {token} pltf_{token}\n"
|
|
lines.append(line)
|
|
|
|
lines.append(f"#endif // {hg_tag}\n")
|
|
# for line in lines:
|
|
# print(line)
|
|
|
|
with open("./src/pltf/internal/gl_func_alias.h", "w") as f:
|
|
f.writelines(lines)
|