From 4126124e0fbab2e80b3e7c8c9f78220111376639 Mon Sep 17 00:00:00 2001 From: Loreno Heer <45607337+loreno-heer@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:40:03 +0200 Subject: [PATCH] Update program.py Better #include handling using regex --- moderngl_window/opengl/program.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moderngl_window/opengl/program.py b/moderngl_window/opengl/program.py index 3035650..bd22093 100644 --- a/moderngl_window/opengl/program.py +++ b/moderngl_window/opengl/program.py @@ -315,7 +315,7 @@ def handle_includes(self, load_source_func, depth=0, source_id=0): for nr, line in enumerate(self._lines): line = line.strip() if line.startswith("#include"): - path = line[9:] + path = re.search(r'#include\s+"?([^"]+)',line)[1] current_id += 1 _, source = load_source_func(path) source = ShaderSource(