Permalink
Browse files

Add a small ShaderToString Utility

- Just convert Shader to multiline Java String

Signed-off-by: Wenwei Cai <stanley.w.cai@gmail.com>
  • Loading branch information...
swcai committed Jan 6, 2013
1 parent 7c9f4d7 commit 6c2b2b2ca5bfae8817783e016f110504bc650e4d
Showing with 14 additions and 0 deletions.
  1. +14 −0 utils/Shader2String.py
View
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+
+import sys
+
+f = sys.stdin
+if len(sys.argv) > 1:
+ f = open(sys.argv[1])
+
+lines = f.readlines()
+for line in lines[:-1]:
+ print '"' + line.rstrip() + '\\n\" +'
+print '"' + lines[-1].rstrip() + '\\n\"'
+
+f.close()

0 comments on commit 6c2b2b2

Please sign in to comment.