Box implementation, improved window API

This commit is contained in:
Corentin 2021-07-06 17:33:29 +09:00
commit 988b0bdbcd
12 changed files with 224 additions and 27 deletions

15
make.py
View file

@ -2,6 +2,7 @@
import os
from pathlib import Path
import shutil
from umake import make
@ -30,14 +31,16 @@ class Config:
def main():
def pre_compile():
# Compiling fragment shaders
for frag_path in Config.SOURCE_DIR.rglob('*.frag'):
out_path = (Config.BIN_DIR / frag_path.relative_to(Config.SOURCE_DIR))
# Copying OpenGL shaders
src_opengl_shader_path = Config.SOURCE_DIR / 'uui' / 'opengl' / 'shaders'
for shader_path in (
list(src_opengl_shader_path.rglob('*.vert'))
+ list(src_opengl_shader_path.rglob('*.frag'))):
out_path = (Config.BIN_DIR / shader_path.relative_to(Config.SOURCE_DIR))
if not out_path.parent.exists():
out_path.parent.mkdir(parents=True)
if subprocess.run(['glslc', str(frag_path), '-o', str(out_path) + '.spv']).returncode != 0:
print(f'Error while compiling fragment shader {frag_path}')
return
shutil.copy(shader_path, out_path)
Config.PRE_COMPILE_FUNCTION = pre_compile
make(Config)