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 4ad5f809e7
commit 8daeb0a8be
7 changed files with 114 additions and 31 deletions

View File

@@ -98,6 +98,9 @@ public class PdeEditor extends JFrame
JMenuItem saveAsMenuItem;
//JMenuItem beautifyMenuItem;
JRadioButtonMenuItem coreRendererItem;
JRadioButtonMenuItem openglRendererItem;
//
boolean running;
@@ -616,13 +619,49 @@ public class PdeEditor extends JFrame
});
menu.add(item);
//menu.add(newJMenuItem("Stop", 'T'));
menu.add(new JMenuItem("Stop"));
item = new JMenuItem("Stop");
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
handleStop();
}
});
menu.add(item);
JMenu rendererMenu = new JMenu("Renderer");
menu.add(rendererMenu);
coreRendererItem = new JRadioButtonMenuItem("Processing");
rendererMenu.add(coreRendererItem);
coreRendererItem.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
//System.out.println("setting renderer");
//openglRendererItem.setState(false);
//coreRendererItem.setState(true);
PdePreferences.set("renderer", "core");
}
});
openglRendererItem = new JRadioButtonMenuItem("OpenGL");
rendererMenu.add(openglRendererItem);
openglRendererItem.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
//System.out.println("setting renderer");
//openglRendererItem.setState(true);
//coreRendererItem.setState(false);
PdePreferences.set("renderer", "opengl");
}
});
ButtonGroup rendererGroup = new ButtonGroup();
rendererGroup.add(coreRendererItem);
rendererGroup.add(openglRendererItem);
boolean useOpenGL = PdePreferences.get("renderer").equals("opengl");
coreRendererItem.setSelected(!useOpenGL);
openglRendererItem.setSelected(useOpenGL);
//
menu.addSeparator();
//

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()

View File

@@ -1098,6 +1098,11 @@ public class PdeSketch {
externalRuntime = true;
}
// if running in opengl mode, this is gonna be external
if (PdePreferences.get("renderer").equals("opengl")) {
externalRuntime = true;
}
// 2. run preproc on that code using the sugg class name
// to create a single .java file and write to buildpath

View File

@@ -184,6 +184,9 @@ run.external = false
run.window.width.minimum = 120
run.window.height.minimum = 120
# set this to opengl to make it the default renderer
renderer = core
# prompt for sketch location when 'new' is hit
sketchbook.prompt = false

View File

@@ -202,7 +202,7 @@ public class PApplet extends Applet
//loopMethod = true;
looping = true;
redraw = true; // draw this guy once
firstMouseEvent = true;
//firstMouseEvent = true;
/*
// call setup for changed params

View File

@@ -38,6 +38,8 @@ X make play button un-highlight with opengl
X also make window move messages work properly
X very necessary, since opens window at 100x100
X problem was the threading issues
X bring back renderer menu
X reading/saving pref for opengl renderer
X beginFrame() around setup()
X draw mode stuff happens inside setup..
@@ -45,7 +47,14 @@ o or maybe need to get better at size() inside of draw() ?
_ make this consistent with the regular PApplet
_ otherwise things are going to be weird/difficult for debugging
_ when running externally, regular applets don't get placed properly
_ make sure background() gets called at least once with opengl
_ depth() shouldn't be needed for opengl unless actually 3D
_ right now the camera doesn't get set up unless you call depth()
_ when running externally, applets don't always get placed properly
_ problem is in gl and in core, and is inconsistent
_ move more logic for layout into PApplet.. maybe a static method?
_ this way can avoid duplicating / breaking things
_ still threading issues with running opengl
_ first run hangs until quit

View File

@@ -72,6 +72,25 @@ X (basically any time it sees "class" in the code..
X may be subject to errors, but errs on side of just running ext)
X runs out of processing data folder
_ macosx is using /Library instead of ~/Library.. get this fixed
_ domain version wasn't in the stubs.. grr
_ or maybe it's an int or something?
_ preproc: making all functions public that have no specifier
_ this will make draw() etc all much easier
_ as well as the library events
_ focusGained/focusLost was added..
_ basic sample audio playback needed for p5
//
MESS TO SORT
_ what's up with int() -> toInt() conversion?
_ use screen manager to run present mode properly
_ set both versions to require java 1.4
_ change the Info.plist inside macosx
@@ -86,30 +105,6 @@ _ since it may take a long time (i.e. 1000s of screen grabs)
_ scanning sketchbook folder may be extremely slow
_ not sure why this would be the case
_ preproc: making all functions public that have no specifier
_ this will make draw() etc all much easier
_ as well as the library events
_ focusGained/focusLost was added..
_ basic sample audio playback needed for p5
_ what's up with int() -> toInt() conversion?
//
PROBLEMS FOR NEW USERS (workshop)
_ making it easier to draw shapes
_ missing semicolons - better error message
_ "unexpected token void" -> "You're mixing dynamic and static mode"
_ forgetting the quotes around strings
_ separate reference for /dev version
_ angleMode(DEGREES) -> mistyped keywords, caps being wrong
MESS TO SORT
_ subfolders in the 'data' directory don't work
_ make sure that the preproc stuff gets built once
@@ -156,6 +151,21 @@ _ if additional tab is "public" class.. then make external?
......................................................................
PROBLEMS FOR NEW USERS (workshop)
_ making it easier to draw shapes
_ missing semicolons - better error message
_ "unexpected token void" -> "You're mixing dynamic and static mode"
_ forgetting the quotes around strings
_ separate reference for /dev version
_ angleMode(DEGREES) -> mistyped keywords, caps being wrong
more
_ keypressed should maybe throw an error
......................................................................
casey notes
_ sketches no longer require a "data" folder
_ "draw" is not highlighted as a keyword.. other keywords?