mirror of
https://github.com/guezoloic/LearnOpenGL.git
synced 2026-01-25 09:34:16 +00:00
fix(glsl2c): place const to the variables
This commit is contained in:
@@ -5,7 +5,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
line: int = 12
|
line: int = 12
|
||||||
|
|
||||||
def write_binary(content: str) -> str:
|
def write_binary(content: bytes) -> str:
|
||||||
text = ""
|
text = ""
|
||||||
for i, byte in enumerate(content):
|
for i, byte in enumerate(content):
|
||||||
if i % line == 0:
|
if i % line == 0:
|
||||||
@@ -37,8 +37,8 @@ def main() -> int:
|
|||||||
content = src.read_bytes()
|
content = src.read_bytes()
|
||||||
|
|
||||||
with open(dst, "w") as f:
|
with open(dst, "w") as f:
|
||||||
f.write(f"unsigned char {varname}[] = {{\n{write_binary(content)}}};\n")
|
f.write(f"const unsigned char {varname}[] = {{\n{write_binary(content)}}};\n")
|
||||||
f.write(f"unsigned int {varname}_LEN = {len(content)};\n")
|
f.write(f"const unsigned int {varname}_LEN = {len(content)};\n")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user