MCPcopy Index your code
hub / github.com/benfry/processing4 / preprocessShaderSource

Method preprocessShaderSource

core/src/processing/opengl/PGL.java:2034–2051  ·  view source on GitHub ↗
(String[] src0,
                                                   Pattern[] search,
                                                   String[] replace,
                                                   int offset)

Source from the content-addressed store, hash-verified

2032
2033
2034 protected static String[] preprocessShaderSource(String[] src0,
2035 Pattern[] search,
2036 String[] replace,
2037 int offset) {
2038 String[] src = new String[src0.length+offset];
2039 for (int i = 0; i < src0.length; i++) {
2040 String line = src0[i];
2041 int versionIndex = line.indexOf("#version");
2042 if (versionIndex >= 0) {
2043 line = line.substring(0, versionIndex);
2044 }
2045 for (int j = 0; j < search.length; j++) {
2046 line = search[j].matcher(line).replaceAll(replace[j]);
2047 }
2048 src[i+offset] = line;
2049 }
2050 return src;
2051 }
2052
2053 protected static boolean containsVersionDirective(String[] shSrc) {
2054 for (String line : shSrc) {

Callers 2

Calls 1

replaceAllMethod · 0.45

Tested by

no test coverage detected