summaryrefslogtreecommitdiffstats
path: root/tools/glsl_preproc/templates.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tools/glsl_preproc/templates.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/glsl_preproc/templates.py b/tools/glsl_preproc/templates.py
new file mode 100644
index 0000000..b3b6c44
--- /dev/null
+++ b/tools/glsl_preproc/templates.py
@@ -0,0 +1,14 @@
+import jinja2
+import os.path
+
+TEMPLATEDIR = os.path.dirname(__file__) + '/templates'
+TEMPLATES = jinja2.Environment(
+ loader = jinja2.FileSystemLoader(searchpath=TEMPLATEDIR),
+ lstrip_blocks = True,
+ trim_blocks = True,
+)
+
+GLSL_BLOCK_TEMPLATE = TEMPLATES.get_template('glsl_block.c.j2')
+FUNCTION_TEMPLATE = TEMPLATES.get_template('function.c.j2')
+CALL_TEMPLATE = TEMPLATES.get_template('call.c.j2')
+STRUCT_TEMPLATE = TEMPLATES.get_template('struct.c.j2')