mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
viewport size is saved in beginDraw() and restored in endDraw()
This commit is contained in:
@@ -388,6 +388,11 @@ public class PGraphicsOpenGL extends PGraphics3D {
|
||||
gl.glDisable(GL.GL_LIGHT0 + i);
|
||||
}
|
||||
|
||||
// The current viewport is saved, since this
|
||||
// instance of PGraphicsOpenGL might correspond
|
||||
// to an offscreen renderer with a resolution
|
||||
// different from the primary renderer.
|
||||
gl.glPushAttrib(GL.GL_VIEWPORT_BIT);
|
||||
gl.glViewport(0, 0, width, height);
|
||||
if (resized) {
|
||||
// To avoid having garbage in the screen after a resize,
|
||||
@@ -446,7 +451,10 @@ public class PGraphicsOpenGL extends PGraphics3D {
|
||||
if (drawable != null) {
|
||||
drawable.swapBuffers();
|
||||
}
|
||||
|
||||
|
||||
// Restoring previous viewport.
|
||||
gl.glPopAttrib();
|
||||
|
||||
//insideDraw = false;
|
||||
report("bot endDraw()");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user