the return of the renderer menu, and some fixes for classpath

This commit is contained in:
benfry
2005-02-01 14:43:26 +00:00
parent b67bb0de6f
commit 3c4fcc64ec
7 changed files with 114 additions and 31 deletions

View File

@@ -177,10 +177,16 @@ public class PdePreprocessor {
} while (true);
int importsCount = imports.size();
extraImports = new String[importsCount];
extraImports = new String[imports.size()];
imports.copyInto(extraImports);
// if using opengl, add it to the special imports
if (PdePreferences.get("renderer").equals("opengl")) {
extraImports = new String[imports.size() + 1];
imports.copyInto(extraImports);
extraImports[extraImports.length - 1] = "processing.opengl.*";
}
/*
if (codeFolderPackages != null) {
extraImports = new String[importsCount + codeFolderPackages.length];
@@ -340,9 +346,20 @@ public class PdePreprocessor {
}
}
boolean opengl = PdePreferences.get("renderer").equals("opengl");
if (opengl) {
out.println("import processing.opengl.*; ");
}
if (programType < JAVA) {
// open the class definition
out.print("public class " + className + " extends PApplet {");
out.print("public class " + className + " extends ");
if (opengl) {
out.print("PAppletGL");
} else {
out.print("PApplet");
}
out.print(" {");
if (programType == STATIC) {
// now that size() and background() can go inside of draw()