MCPcopy Index your code
hub / github.com/processing/processing / preprocessShaderSource

Method preprocessShaderSource

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

Source from the content-addressed store, hash-verified

1990
1991
1992 protected static String[] preprocessShaderSource(String[] src0,
1993 Pattern[] search,
1994 String[] replace,
1995 int offset) {
1996 String[] src = new String[src0.length+offset];
1997 for (int i = 0; i < src0.length; i++) {
1998 String line = src0[i];
1999 int versionIndex = line.indexOf("#version");
2000 if (versionIndex >= 0) {
2001 line = line.substring(0, versionIndex);
2002 }
2003 for (int j = 0; j < search.length; j++) {
2004 line = search[j].matcher(line).replaceAll(replace[j]);
2005 }
2006 src[i+offset] = line;
2007 }
2008 return src;
2009 }
2010
2011 protected static boolean containsVersionDirective(String[] shSrc) {
2012 for (int i = 0; i < shSrc.length; i++) {

Callers 2

Calls 1

replaceAllMethod · 0.45

Tested by

no test coverage detected