fix getComponent() in AWT, tweak JOGL to compile properly

This commit is contained in:
Ben Fry
2015-04-27 13:58:26 -04:00
parent 3982af6d88
commit 6d82b34eb5
5 changed files with 25 additions and 8 deletions
+1
View File
@@ -97,6 +97,7 @@ public interface PSurface {
//public void initImage(PGraphics gr, int wide, int high);
// create pixel buffer, called from allocate() to produce a compatible image for rendering efficiently
// public void initImage(PGraphics gr);
public Component getComponent();
/**
@@ -803,6 +803,12 @@ public class PSurfaceAWT extends PSurfaceNone {
*/
@Override
public Component getComponent() {
return canvas;
}
@Override
public void setSmooth(int level) {
}
+2
View File
@@ -14,6 +14,8 @@ _ may be cause of some of the display placement issues w/ multiple displays
_ seem to recall one of the bugs mentioning stacked displays
_ need to change to iterate through display rectangles
_ tweak mode ColorSelector is broken (uses getComponent())
_ closing a sketch window manually (not hitting Stop) not killing sketch
_ at least with the Java2D renderer
rendering/performance/surface
@@ -2,6 +2,7 @@ package processing.jogl;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.Rectangle;
@@ -60,24 +61,26 @@ public class PSurfaceJOGL implements PSurface {
Throwable drawException;
Object waitObject = new Object();
NewtCanvasAWT canvas;
public PSurfaceJOGL(PGraphics graphics) {
this.graphics = graphics;
this.pgl = (PJOGL) ((PGraphicsOpenGL)graphics).pgl;
}
public void initOffscreen() {
public void initOffscreen(PApplet sketch) {
// TODO Auto-generated method stub
}
public Canvas initCanvas(PApplet sketch) {
public Canvas initComponent(PApplet sketch) {
this.sketch = sketch;
sketchWidth = sketch.sketchWidth();
sketchHeight = sketch.sketchHeight();
if (window != null) {
NewtCanvasAWT canvas = new NewtCanvasAWT(window);
canvas = new NewtCanvasAWT(window);
canvas.setBounds(0, 0, window.getWidth(), window.getHeight());
// canvas.setBackground(new Color(pg.backgroundColor, true));
canvas.setFocusable(true);
@@ -424,6 +427,10 @@ public class PSurfaceJOGL implements PSurface {
}
}
public Component getComponent() {
return canvas;
}
public void setSmooth(int level) {
pgl.reqNumSamples = level;
GLCapabilities caps = new GLCapabilities(profile);
@@ -453,10 +460,6 @@ public class PSurfaceJOGL implements PSurface {
}
public void blit() {
// TODO Auto-generated method stub
}
class DrawListener implements GLEventListener {
public void display(GLAutoDrawable drawable) {
pgl.getGL(drawable);
+5
View File
@@ -10,6 +10,9 @@ _ Error message changes from "function" to "method"
_ https://github.com/processing/processing/issues/3225
_ move processing-java inside the Java Mode?
_ make a Tool that installs it for all platforms, not just OS X
_ not really part of the 'build' anymore
_ fix this error message: Experimental Mode: Yikes! Can't find "processing.opengl" library! Line: 2 in tab: particle_signature_30_01
_ 'ant clean' not removing old versions created by dist
_ finish adding 'examples' contribs
@@ -41,6 +44,8 @@ _ break out a gui package (get class count down in .app)
_ remove deprecated methods
_ do the right thing on passing around List vs ArrayList and others
_ PreferencesFrame is a misnomer (not a frame itself)
_ change to PreferencesDialog, and make it a dialog?
_ move Library to LibraryContribution and into contrib?
gui