mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fix getComponent() in AWT, tweak JOGL to compile properly
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user