mirror of
https://github.com/processing/processing4.git
synced 2026-02-13 10:30:44 +01:00
Merge pull request #7 from codeanticode/master
some minor changes to jogl, lwjgl
This commit is contained in:
@@ -25,6 +25,7 @@ package processing.opengl;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Canvas;
|
||||
import java.awt.Color;
|
||||
import java.nio.Buffer;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
@@ -632,6 +633,8 @@ public class PGL {
|
||||
if (toolkit == AWT) {
|
||||
canvasAWT = new GLCanvas(caps);
|
||||
canvasAWT.setBounds(0, 0, pg.width, pg.height);
|
||||
canvasAWT.setBackground(Color.BLACK);
|
||||
canvasAWT.setForeground(Color.BLACK);
|
||||
|
||||
pg.parent.setLayout(new BorderLayout());
|
||||
pg.parent.add(canvasAWT, BorderLayout.CENTER);
|
||||
@@ -652,6 +655,8 @@ public class PGL {
|
||||
window = GLWindow.create(caps);
|
||||
canvasNEWT = new NewtCanvasAWT(window);
|
||||
canvasNEWT.setBounds(0, 0, pg.width, pg.height);
|
||||
canvasNEWT.setBackground(Color.BLACK);
|
||||
canvasNEWT.setForeground(Color.BLACK);
|
||||
|
||||
pg.parent.setLayout(new BorderLayout());
|
||||
pg.parent.add(canvasNEWT, BorderLayout.CENTER);
|
||||
|
||||
@@ -497,24 +497,24 @@ public class PGL extends processing.opengl.PGL {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Display.destroy();
|
||||
|
||||
pg.parent.remove(canvas);
|
||||
}
|
||||
|
||||
canvas = new Canvas();
|
||||
canvas.setFocusable(true);
|
||||
canvas.requestFocus();
|
||||
canvas.setIgnoreRepaint(true);
|
||||
canvas.setBackground(Color.BLACK);
|
||||
canvas.setForeground(Color.BLACK);
|
||||
canvas.setForeground(Color.BLACK);
|
||||
canvas.setBounds(0, 0, pg.parent.width, pg.parent.height);
|
||||
|
||||
pg.parent.setLayout(new BorderLayout());
|
||||
pg.parent.add(canvas, BorderLayout.CENTER);
|
||||
canvas.setBounds(0, 0, pg.parent.width, pg.parent.height);
|
||||
pg.parent.add(canvas, BorderLayout.CENTER);
|
||||
|
||||
try {
|
||||
PixelFormat format = new PixelFormat(32, request_alpha_bits,
|
||||
request_depth_bits,
|
||||
request_stencil_bits, 0);
|
||||
request_stencil_bits, 1);
|
||||
Display.setDisplayMode(new DisplayMode(pg.parent.width, pg.parent.height));
|
||||
Display.setParent(canvas);
|
||||
Display.create(format);
|
||||
|
||||
Reference in New Issue
Block a user