mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
use WINDOW_BGCOLOR
This commit is contained in:
@@ -35,6 +35,7 @@ import java.util.Arrays;
|
||||
|
||||
import processing.core.PApplet;
|
||||
import processing.core.PGraphics;
|
||||
import processing.core.PSurface;
|
||||
|
||||
|
||||
/**
|
||||
@@ -586,9 +587,20 @@ public abstract class PGL {
|
||||
// Draw the contents of the back texture to the screen framebuffer.
|
||||
bindFramebufferImpl(FRAMEBUFFER, 0);
|
||||
|
||||
clearDepth(1);
|
||||
clearColor(0, 0, 0, 0);
|
||||
clear(COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT);
|
||||
|
||||
if (presentMode) {
|
||||
float a = PSurface.WINDOW_BGCOLOR.getAlpha() / 255.0f;
|
||||
float r = PSurface.WINDOW_BGCOLOR.getRed() / 255.0f;
|
||||
float g = PSurface.WINDOW_BGCOLOR.getGreen() / 255.0f;
|
||||
float b = PSurface.WINDOW_BGCOLOR.getBlue() / 255.0f;
|
||||
clearDepth(1);
|
||||
clearColor(r, g, b, a);
|
||||
clear(COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT);
|
||||
} else {
|
||||
clearDepth(1);
|
||||
clearColor(0, 0, 0, 0);
|
||||
clear(COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
// Render current back texture to screen, without blending.
|
||||
disable(BLEND);
|
||||
|
||||
@@ -334,6 +334,9 @@ public class PSurfaceLWJGL implements PSurface {
|
||||
offsetX = pgl.offsetX = 0.5f * (screenRect.width - sketchWidth);
|
||||
offsetY = pgl.offsetY = 0.5f * (screenRect.height - sketchHeight);
|
||||
pgl.requestFBOLayer();
|
||||
|
||||
|
||||
|
||||
// try {
|
||||
//// Display.setFullscreen(true);
|
||||
// Display.setDisplayMode(new DisplayMode(screenRect.width, screenRect.height));
|
||||
@@ -342,10 +345,11 @@ public class PSurfaceLWJGL implements PSurface {
|
||||
// e1.printStackTrace();
|
||||
// }
|
||||
|
||||
/*
|
||||
/*
|
||||
presentFrame = new JFrame(displayDevice.getDefaultConfiguration());
|
||||
presentFrame.getContentPane().setBackground(WINDOW_BGCOLOR);
|
||||
|
||||
|
||||
// presentCanvas = new Canvas();
|
||||
// presentCanvas.setFocusable(true);
|
||||
// presentCanvas.requestFocus();
|
||||
@@ -981,7 +985,7 @@ public class PSurfaceLWJGL implements PSurface {
|
||||
modifiers |= Event.ALT;
|
||||
}
|
||||
|
||||
PApplet.println(Mouse.getX(), Mouse.getY(), offsetX, offsetY);
|
||||
// PApplet.println(Mouse.getX(), Mouse.getY(), offsetX, offsetY);
|
||||
int x = Mouse.getX() - (int)offsetX;
|
||||
int y = sketchHeight - (Mouse.getY() - (int)offsetY);
|
||||
int button = 0;
|
||||
|
||||
Reference in New Issue
Block a user