From af746c00d0071649a3802b8a2387600b7953c853 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 28 Jan 2015 17:57:31 -0500 Subject: [PATCH 1/7] another way to implement present mode w/out AWT --- core/src/processing/opengl/PGL.java | 17 +- .../src/processing/lwjgl/PSurfaceLWJGL.java | 269 +++--------------- 2 files changed, 47 insertions(+), 239 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index a8451572b..6d37e7987 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -316,6 +316,11 @@ public abstract class PGL { ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN; + + public boolean presentMode = false; + public float offsetX; + public float offsetY; + /////////////////////////////////////////////////////////////// // Initialization, finalization @@ -410,7 +415,7 @@ public abstract class PGL { } - protected void requestFBOLayer() { + public void requestFBOLayer() { fboLayerRequested = true; } @@ -526,6 +531,8 @@ public abstract class PGL { if (needFBOLayer(clear0)) { if (!fboLayerCreated) createFBOLayer(); +// System.err.println("Using FBO layer"); + bindFramebufferImpl(FRAMEBUFFER, glColorFbo.get(0)); framebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0, TEXTURE_2D, glColorTex.get(backTex), 0); @@ -561,14 +568,14 @@ public abstract class PGL { firstFrame = false; } - if (!USE_FBOLAYER_BY_DEFAULT) { +// if (!USE_FBOLAYER_BY_DEFAULT) { // The result of this assignment is the following: if the user requested // at some point the use of the FBO layer, but subsequently didn't // request it again, then the rendering won't render to the FBO layer if // not needed by the config, since it is slower than simple onscreen // rendering. - fboLayerRequested = false; - } +// fboLayerRequested = false; +// } } @@ -967,7 +974,7 @@ public abstract class PGL { // Making sure that the viewport matches the provided screen dimensions viewBuffer.rewind(); getIntegerv(VIEWPORT, viewBuffer); - viewport(0, 0, scrW, scrH); + viewport((int)offsetX, (int)offsetY, scrW, scrH); useProgram(ppgl.tex2DShaderProgram); diff --git a/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java b/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java index 853a149ac..92d9f97f8 100644 --- a/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java +++ b/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java @@ -9,9 +9,7 @@ import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; //import java.awt.Insets; -import java.awt.Label; import java.awt.Rectangle; -import java.awt.event.MouseAdapter; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.nio.IntBuffer; @@ -201,8 +199,13 @@ public class PSurfaceLWJGL implements PSurface { float r = ((argb >> 16) & 0xff) / 255.0f; float g = ((argb >> 8) & 0xff) / 255.0f; float b = ((argb) & 0xff) / 255.0f; - Display.setInitialBackground(r, g, b); - Display.setDisplayMode(new DisplayMode(sketchWidth, sketchHeight)); + Display.setInitialBackground(r, g, b); + if (fullScreen) { + Display.setDisplayMode(new DisplayMode(screenRect.width, screenRect.height)); + } else { + Display.setDisplayMode(new DisplayMode(sketchWidth, sketchHeight)); + } + System.err.println(sketchWidth + " " + sketchHeight); if (fullScreenRequested) { Display.setFullscreen(true); @@ -318,11 +321,28 @@ public class PSurfaceLWJGL implements PSurface { JFrame presentFrame; Canvas presentCanvas; + boolean presentMode = false; + float offsetX; + float offsetY; @Override public void placePresent(Color stopColor) { if (sketchWidth < screenRect.width || sketchHeight < screenRect.height) { - + System.err.println("WILL USE FBO"); + + presentMode = pgl.presentMode = true; + 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)); +// } catch (LWJGLException e1) { +// // TODO Auto-generated catch block +// e1.printStackTrace(); +// } + + /* presentFrame = new JFrame(displayDevice.getDefaultConfiguration()); presentFrame.getContentPane().setBackground(WINDOW_BGCOLOR); @@ -369,6 +389,7 @@ public class PSurfaceLWJGL implements PSurface { label.setSize(labelSize); label.setLocation(20, screenRect.height - labelSize.height - 20); } + */ } @@ -703,6 +724,7 @@ public class PSurfaceLWJGL implements PSurface { deinit = false; break; } +// System.err.println(Display.isActive()); } if (deinit) { @@ -738,6 +760,11 @@ public class PSurfaceLWJGL implements PSurface { Display.setResizable(resizable); } +// @Override +// public void setLocation(int x, int y) { +// Display.setLocation(x, y); +// } + @Override public void setVisible(boolean visible) { // Display.isVisible() @@ -954,8 +981,9 @@ public class PSurfaceLWJGL implements PSurface { modifiers |= Event.ALT; } - int x = Mouse.getX(); - int y = sketchHeight - Mouse.getY(); + PApplet.println(Mouse.getX(), Mouse.getY(), offsetX, offsetY); + int x = Mouse.getX() - (int)offsetX; + int y = sketchHeight - (Mouse.getY() - (int)offsetY); int button = 0; if (Mouse.isButtonDown(0)) { button = PConstants.LEFT; @@ -1095,232 +1123,5 @@ public class PSurfaceLWJGL implements PSurface { System.err.println("ERROR: Invalid LWJGL KeyCode " + code); return -1; } - - - /* - switch (code) { - case Keyboard.KEY_0: - return java.awt.event.KeyEvent.VK_0; - case Keyboard.KEY_1: - return java.awt.event.KeyEvent.VK_1; - case Keyboard.KEY_2: - return java.awt.event.KeyEvent.VK_2; - case Keyboard.KEY_3: - return java.awt.event.KeyEvent.VK_3; - case Keyboard.KEY_4: - return java.awt.event.KeyEvent.VK_4; - case Keyboard.KEY_5: - return java.awt.event.KeyEvent.VK_5; - case Keyboard.KEY_6: - return java.awt.event.KeyEvent.VK_6; - case Keyboard.KEY_7: - return java.awt.event.KeyEvent.VK_7; - case Keyboard.KEY_8: - return java.awt.event.KeyEvent.VK_8; - case Keyboard.KEY_9: - return java.awt.event.KeyEvent.VK_9; - case Keyboard.KEY_A: - return java.awt.event.KeyEvent.VK_A; - case Keyboard.KEY_B: - return java.awt.event.KeyEvent.VK_B; - case Keyboard.KEY_C: - return java.awt.event.KeyEvent.VK_C; - case Keyboard.KEY_D: - return java.awt.event.KeyEvent.VK_D; - case Keyboard.KEY_E: - return java.awt.event.KeyEvent.VK_E; - case Keyboard.KEY_F: - return java.awt.event.KeyEvent.VK_F; - case Keyboard.KEY_G: - return java.awt.event.KeyEvent.VK_G; - case Keyboard.KEY_H: - return java.awt.event.KeyEvent.VK_H; - case Keyboard.KEY_I: - return java.awt.event.KeyEvent.VK_I; - case Keyboard.KEY_J: - return java.awt.event.KeyEvent.VK_J; - case Keyboard.KEY_K: - return java.awt.event.KeyEvent.VK_K; - case Keyboard.KEY_L: - return java.awt.event.KeyEvent.VK_L; - case Keyboard.KEY_M: - return java.awt.event.KeyEvent.VK_M; - case Keyboard.KEY_N: - return java.awt.event.KeyEvent.VK_N; - case Keyboard.KEY_O: - return java.awt.event.KeyEvent.VK_O; - case Keyboard.KEY_P: - return java.awt.event.KeyEvent.VK_P; - case Keyboard.KEY_Q: - return java.awt.event.KeyEvent.VK_Q; - case Keyboard.KEY_R: - return java.awt.event.KeyEvent.VK_R; - case Keyboard.KEY_S: - return java.awt.event.KeyEvent.VK_S; - case Keyboard.KEY_T: - return java.awt.event.KeyEvent.VK_T; - case Keyboard.KEY_U: - return java.awt.event.KeyEvent.VK_U; - case Keyboard.KEY_V: - return java.awt.event.KeyEvent.VK_V; - case Keyboard.KEY_W: - return java.awt.event.KeyEvent.VK_W; - case Keyboard.KEY_X: - return java.awt.event.KeyEvent.VK_X; - case Keyboard.KEY_Y: - return java.awt.event.KeyEvent.VK_Y; - case Keyboard.KEY_Z: - return java.awt.event.KeyEvent.VK_Z; - case Keyboard.KEY_ADD: - return java.awt.event.KeyEvent.VK_ADD; - case Keyboard.KEY_APOSTROPHE: - return java.awt.event.KeyEvent.VK_ASTERISK; - case Keyboard.KEY_AT: - return java.awt.event.KeyEvent.VK_AT; - case Keyboard.KEY_BACK: - return java.awt.event.KeyEvent.VK_BACK_SPACE; - case Keyboard.KEY_BACKSLASH: - return java.awt.event.KeyEvent.VK_BACK_SLASH; - case Keyboard.KEY_CAPITAL: - return java.awt.event.KeyEvent.VK_CAPS_LOCK; - case Keyboard.KEY_CIRCUMFLEX: - return java.awt.event.KeyEvent.VK_CIRCUMFLEX; - case Keyboard.KEY_COLON: - return java.awt.event.KeyEvent.VK_COLON; - case Keyboard.KEY_COMMA: - return java.awt.event.KeyEvent.VK_COMMA; - case Keyboard.KEY_CONVERT: - return java.awt.event.KeyEvent.VK_CONVERT; - case Keyboard.KEY_DECIMAL: - return java.awt.event.KeyEvent.VK_DECIMAL; - case Keyboard.KEY_DELETE: - return java.awt.event.KeyEvent.VK_DELETE; - case Keyboard.KEY_DIVIDE: - return java.awt.event.KeyEvent.VK_DIVIDE; - case Keyboard.KEY_DOWN: - return java.awt.event.KeyEvent.VK_DOWN; - case Keyboard.KEY_END: - return java.awt.event.KeyEvent.VK_END; - case Keyboard.KEY_EQUALS: - return java.awt.event.KeyEvent.VK_EQUALS; - case Keyboard.KEY_ESCAPE: - return java.awt.event.KeyEvent.VK_ESCAPE; - case Keyboard.KEY_F1: - return java.awt.event.KeyEvent.VK_F1; - case Keyboard.KEY_F10: - return java.awt.event.KeyEvent.VK_F10; - case Keyboard.KEY_F11: - return java.awt.event.KeyEvent.VK_F11; - case Keyboard.KEY_F12: - return java.awt.event.KeyEvent.VK_F12; - case Keyboard.KEY_F13: - return java.awt.event.KeyEvent.VK_F13; - case Keyboard.KEY_F14: - return java.awt.event.KeyEvent.VK_F14; - case Keyboard.KEY_F15: - return java.awt.event.KeyEvent.VK_F15; - case Keyboard.KEY_F2: - return java.awt.event.KeyEvent.VK_F2; - case Keyboard.KEY_F3: - return java.awt.event.KeyEvent.VK_F3; - case Keyboard.KEY_F4: - return java.awt.event.KeyEvent.VK_F4; - case Keyboard.KEY_F5: - return java.awt.event.KeyEvent.VK_F5; - case Keyboard.KEY_F6: - return java.awt.event.KeyEvent.VK_F6; - case Keyboard.KEY_F7: - return java.awt.event.KeyEvent.VK_F7; - case Keyboard.KEY_F8: - return java.awt.event.KeyEvent.VK_F8; - case Keyboard.KEY_F9: - return java.awt.event.KeyEvent.VK_F9; -// case Keyboard.KEY_GRAVE: - case Keyboard.KEY_HOME: - return java.awt.event.KeyEvent.VK_HOME; - case Keyboard.KEY_INSERT: - return java.awt.event.KeyEvent.VK_INSERT; - case Keyboard.KEY_LBRACKET: - return java.awt.event.KeyEvent.VK_BRACELEFT; - case Keyboard.KEY_LCONTROL: - return java.awt.event.KeyEvent.VK_CONTROL; - case Keyboard.KEY_LEFT: - return java.awt.event.KeyEvent.VK_LEFT; - case Keyboard.KEY_LMENU: - return java.awt.event.KeyEvent.VK_ALT; - case Keyboard.KEY_LMETA: - return java.awt.event.KeyEvent.VK_META; - case Keyboard.KEY_LSHIFT: - return java.awt.event.KeyEvent.VK_SHIFT; - case Keyboard.KEY_MINUS: - return java.awt.event.KeyEvent.VK_MINUS; - case Keyboard.KEY_MULTIPLY: - return java.awt.event.KeyEvent.VK_MULTIPLY; -// case Keyboard.KEY_NEXT: - case Keyboard.KEY_NUMLOCK: - return java.awt.event.KeyEvent.VK_NUM_LOCK; - case Keyboard.KEY_NUMPAD0: - return java.awt.event.KeyEvent.VK_NUMPAD0; - case Keyboard.KEY_NUMPAD1: - return java.awt.event.KeyEvent.VK_NUMPAD1; - case Keyboard.KEY_NUMPAD2: - return java.awt.event.KeyEvent.VK_NUMPAD2; - case Keyboard.KEY_NUMPAD3: - return java.awt.event.KeyEvent.VK_NUMPAD3; - case Keyboard.KEY_NUMPAD4: - return java.awt.event.KeyEvent.VK_NUMPAD4; - case Keyboard.KEY_NUMPAD5: - return java.awt.event.KeyEvent.VK_NUMPAD5; - case Keyboard.KEY_NUMPAD6: - return java.awt.event.KeyEvent.VK_NUMPAD6; - case Keyboard.KEY_NUMPAD7: - return java.awt.event.KeyEvent.VK_NUMPAD7; - case Keyboard.KEY_NUMPAD8: - return java.awt.event.KeyEvent.VK_NUMPAD8; - case Keyboard.KEY_NUMPAD9: - return java.awt.event.KeyEvent.VK_NUMPAD9; -// case Keyboard.KEY_NUMPADCOMMA: -// case Keyboard.KEY_NUMPADENTER: -// case Keyboard.KEY_NUMPADEQUALS: - case Keyboard.KEY_PAUSE: - return java.awt.event.KeyEvent.VK_PAUSE; - case Keyboard.KEY_PERIOD: - return java.awt.event.KeyEvent.VK_PERIOD; -// case Keyboard.KEY_POWER: -// case Keyboard.KEY_PRIOR: - case Keyboard.KEY_RBRACKET: - return java.awt.event.KeyEvent.VK_BRACERIGHT; - case Keyboard.KEY_RCONTROL: - return java.awt.event.KeyEvent.VK_CONTROL; - case Keyboard.KEY_RETURN: - return java.awt.event.KeyEvent.VK_ENTER; - case Keyboard.KEY_RIGHT: - return java.awt.event.KeyEvent.VK_RIGHT; -// case Keyboard.KEY_RMENU: - case Keyboard.KEY_RMETA: - return java.awt.event.KeyEvent.VK_META; - case Keyboard.KEY_RSHIFT: - return java.awt.event.KeyEvent.VK_SHIFT; -// case Keyboard.KEY_SCROLL: - case Keyboard.KEY_SEMICOLON: - return java.awt.event.KeyEvent.VK_SEMICOLON; - case Keyboard.KEY_SLASH: - return java.awt.event.KeyEvent.VK_SLASH; -// case Keyboard.KEY_SLEEP: - case Keyboard.KEY_SPACE: - return java.awt.event.KeyEvent.VK_SPACE; - case Keyboard.KEY_STOP: - return java.awt.event.KeyEvent.VK_STOP; - case Keyboard.KEY_SUBTRACT: - return java.awt.event.KeyEvent.VK_SUBTRACT; - case Keyboard.KEY_TAB: - return java.awt.event.KeyEvent.VK_TAB; -// case Keyboard.KEY_UNDERLINE: - case Keyboard.KEY_UP: - return java.awt.event.KeyEvent.VK_UP; - default: - return 0; - } - */ } } From ca5aa10d718c539f99dd183563a57c493b254a03 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 28 Jan 2015 18:15:36 -0500 Subject: [PATCH 2/7] use WINDOW_BGCOLOR --- core/src/processing/opengl/PGL.java | 18 +++++++++++++++--- .../src/processing/lwjgl/PSurfaceLWJGL.java | 8 ++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 6d37e7987..5db34b953 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -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); diff --git a/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java b/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java index 92d9f97f8..3aa0d2726 100644 --- a/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java +++ b/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java @@ -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; From eaac9b14a2aaebb4d4c2adfdc30ef71fdd0dddc7 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 28 Jan 2015 18:48:40 -0500 Subject: [PATCH 3/7] draw exit label in PGL --- core/src/processing/opengl/PGL.java | 16 ++++++++++++++++ .../src/processing/lwjgl/PSurfaceLWJGL.java | 11 +++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 5db34b953..b0e719dcd 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -580,6 +580,7 @@ public abstract class PGL { } + int labelTex = -1; protected void endDraw(boolean clear0) { if (fboLayerInUse) { syncBackTexture(); @@ -596,6 +597,21 @@ public abstract class PGL { clearDepth(1); clearColor(r, g, b, a); clear(COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT); + + if (labelTex == -1) { +// labelTex = new Texture(pg); +// labelTex.init(100, 50, +// glColorTex.get(backTex), TEXTURE_2D, RGBA, +// fboWidth, fboHeight, NEAREST, NEAREST, +// CLAMP_TO_EDGE, CLAMP_TO_EDGE); + } + + // Don't use presentMode offset! +// drawTexture2D(labelTex, int texW, int texH, int scrW, int scrH, +// int texX0, int texY0, int texX1, int texY1, +// int scrX0, int scrY0, int scrX1, int scrY1); + + } else { clearDepth(1); clearColor(0, 0, 0, 0); diff --git a/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java b/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java index 3aa0d2726..f40701b56 100644 --- a/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java +++ b/java/libraries/lwjgl/src/processing/lwjgl/PSurfaceLWJGL.java @@ -426,8 +426,6 @@ public class PSurfaceLWJGL implements PSurface { label.setLocation(20, screenRect.height - labelSize.height - 20); } */ - - } @Override @@ -1007,6 +1005,15 @@ public class PSurfaceLWJGL implements PSurface { } } else if (pressed) { action = MouseEvent.RELEASE; + + if (presentMode) { + if (20 < Mouse.getX() && Mouse.getX() < 20 + 100 && + 20 < Mouse.getY() && Mouse.getY() < 20 + 50) { + System.err.println("clicked on exit button"); + sketch.exit(); + } + } + pressed = false; } else { action = MouseEvent.MOVE; From d22eee76fd595be38f0619e5d3f476cd0bb8da56 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Thu, 29 Jan 2015 00:49:06 -0500 Subject: [PATCH 4/7] draw label texture --- core/src/processing/opengl/PGL.java | 89 +++++++++++++------ .../processing/opengl/PGraphicsOpenGL.java | 8 +- core/src/processing/opengl/Texture.java | 16 ++-- 3 files changed, 74 insertions(+), 39 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index b0e719dcd..9f51b00e2 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -554,10 +554,16 @@ public abstract class PGL { } else if (!clear0) { // Render previous back texture (now is the front) as background, // because no background() is being used ("incremental drawing") - drawTexture(TEXTURE_2D, glColorTex.get(frontTex), - fboWidth, fboHeight, pg.width, pg.height, - 0, 0, pg.width, pg.height, - 0, 0, pg.width, pg.height); + int x = 0; + int y = 0; + if (presentMode) { + x = (int)offsetX; + y = (int)offsetY; + } + drawTexture(TEXTURE_2D, glColorTex.get(frontTex), fboWidth, fboHeight, + x, y, pg.width, pg.height, + 0, 0, pg.width, pg.height, + 0, 0, pg.width, pg.height); } fboLayerInUse = true; @@ -580,7 +586,7 @@ public abstract class PGL { } - int labelTex = -1; + IntBuffer labelTex; protected void endDraw(boolean clear0) { if (fboLayerInUse) { syncBackTexture(); @@ -598,19 +604,34 @@ public abstract class PGL { clearColor(r, g, b, a); clear(COLOR_BUFFER_BIT | DEPTH_BUFFER_BIT); - if (labelTex == -1) { -// labelTex = new Texture(pg); -// labelTex.init(100, 50, -// glColorTex.get(backTex), TEXTURE_2D, RGBA, -// fboWidth, fboHeight, NEAREST, NEAREST, -// CLAMP_TO_EDGE, CLAMP_TO_EDGE); + if (labelTex == null) { + labelTex = allocateIntBuffer(1); + genTextures(1, labelTex); + bindTexture(TEXTURE_2D, labelTex.get(0)); + texParameteri(TEXTURE_2D, TEXTURE_MIN_FILTER, NEAREST); + texParameteri(TEXTURE_2D, TEXTURE_MAG_FILTER, NEAREST); + texParameteri(TEXTURE_2D, TEXTURE_WRAP_S, CLAMP_TO_EDGE); + texParameteri(TEXTURE_2D, TEXTURE_WRAP_T, CLAMP_TO_EDGE); + texImage2D(TEXTURE_2D, 0, RGBA, 100, 50, 0, RGBA, UNSIGNED_BYTE, null); + initTexture(TEXTURE_2D, RGBA, 100, 50, pg.backgroundColor); + bindTexture(TEXTURE_2D, 0); } + drawTexture(TEXTURE_2D, labelTex.get(0), 100, 50, + 0, 0, 20 + 100, 20 + 50, + 0, 0, 100, 50, + 20, 20, 20 + 100, 20 + 50); +/* // Don't use presentMode offset! -// drawTexture2D(labelTex, int texW, int texH, int scrW, int scrH, -// int texX0, int texY0, int texX1, int texY1, -// int scrX0, int scrY0, int scrX1, int scrY1); + drawTexture(TEXTURE_2D, labelTex.get(0), + 100, 50, pg.width, pg.height, + 0, 0, pg.width, pg.height, + 0, 0, pg.width, pg.height); + drawTexture2D(labelTex.get(0), 100, 50, int scrW, int scrH, + 0, 0, 100, 50, + int scrX0, int scrY0, int scrX1, int scrY1); +*/ } else { clearDepth(1); @@ -620,9 +641,17 @@ public abstract class PGL { // Render current back texture to screen, without blending. disable(BLEND); + int x = 0; + int y = 0; + if (presentMode) { + x = (int)offsetX; + y = (int)offsetY; + } drawTexture(TEXTURE_2D, glColorTex.get(backTex), - fboWidth, fboHeight, pg.width, pg.height, - 0, 0, pg.width, pg.height, 0, 0, pg.width, pg.height); + fboWidth, fboHeight, + x, y, pg.width, pg.height, + 0, 0, pg.width, pg.height, + 0, 0, pg.width, pg.height); // Swapping front and back textures. int temp = frontTex; @@ -887,7 +916,7 @@ public abstract class PGL { protected void initTexture(int target, int format, int width, int height, - int initColor) { + int initColor) { int[] glcolor = new int[16 * 16]; Arrays.fill(glcolor, javaToNativeARGB(initColor)); IntBuffer texels = allocateDirectIntBuffer(16 * 16); @@ -925,24 +954,28 @@ public abstract class PGL { */ public void drawTexture(int target, int id, int width, int height, int X0, int Y0, int X1, int Y1) { - drawTexture(target, id, width, height, width, height, - X0, Y0, X1, Y1, X0, Y0, X1, Y1); + drawTexture(target, id, width, height, + 0, 0, width, height, + X0, Y0, X1, Y1, + X0, Y0, X1, Y1); } /** * Not an approved function, this will change or be removed in the future. */ - public void drawTexture(int target, int id, - int texW, int texH, int scrW, int scrH, + public void drawTexture(int target, int id,int texW, int texH, + int viewX, int viewY, int scrW, int scrH, int texX0, int texY0, int texX1, int texY1, int scrX0, int scrY0, int scrX1, int scrY1) { if (target == TEXTURE_2D) { - drawTexture2D(id, texW, texH, scrW, scrH, + drawTexture2D(id, texW, texH, + viewX, viewY, scrW, scrH, texX0, texY0, texX1, texY1, scrX0, scrY0, scrX1, scrY1); } else if (target == TEXTURE_RECTANGLE) { - drawTextureRect(id, texW, texH, scrW, scrH, + drawTextureRect(id, texW, texH, + viewX, viewY, scrW, scrH, texX0, texY0, texX1, texY1, scrX0, scrY0, scrX1, scrY1); } @@ -982,7 +1015,8 @@ public abstract class PGL { } - protected void drawTexture2D(int id, int texW, int texH, int scrW, int scrH, + protected void drawTexture2D(int id, int texW, int texH, + int viewX, int viewY, int scrW, int scrH, int texX0, int texY0, int texX1, int texY1, int scrX0, int scrY0, int scrX1, int scrY1) { PGL ppgl = initTex2DShader(); @@ -1002,7 +1036,7 @@ public abstract class PGL { // Making sure that the viewport matches the provided screen dimensions viewBuffer.rewind(); getIntegerv(VIEWPORT, viewBuffer); - viewport((int)offsetX, (int)offsetY, scrW, scrH); + viewport(viewX, viewY, scrW, scrH); useProgram(ppgl.tex2DShaderProgram); @@ -1108,7 +1142,8 @@ public abstract class PGL { } - protected void drawTextureRect(int id, int texW, int texH, int scrW, int scrH, + protected void drawTextureRect(int id, int texW, int texH, + int viewX, int viewY, int scrW, int scrH, int texX0, int texY0, int texX1, int texY1, int scrX0, int scrY0, int scrX1, int scrY1) { PGL ppgl = initTexRectShader(); @@ -1132,7 +1167,7 @@ public abstract class PGL { // Making sure that the viewport matches the provided screen dimensions viewBuffer.rewind(); getIntegerv(VIEWPORT, viewBuffer); - viewport(0, 0, scrW, scrH); + viewport(viewX, viewY, scrW, scrH); useProgram(ppgl.texRectShaderProgram); diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index e2a7fafc7..447633e2c 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -5772,8 +5772,8 @@ public class PGraphicsOpenGL extends PGraphics { // Processing Y axis is inverted with respect to OpenGL, so we need to // invert the y coordinates of the screen rectangle. pgl.disable(PGL.BLEND); - pgl.drawTexture(texture.glTarget, texture.glName, - texture.glWidth, texture.glHeight, width, height, + pgl.drawTexture(texture.glTarget, texture.glName, texture.glWidth, texture.glHeight, + 0, 0, width, height, x, y, x + w, y + h, x, height - (y + h), x + w, height - y); pgl.enable(PGL.BLEND); @@ -5993,8 +5993,8 @@ public class PGraphicsOpenGL extends PGraphics { texY1 = sy + sh; } - pgl.drawTexture(tex.glTarget, tex.glName, - tex.glWidth, tex.glHeight, width, height, + pgl.drawTexture(tex.glTarget, tex.glName, tex.glWidth, tex.glHeight, + 0, 0, width, height, texX0, texY0, texX1, texY1, scrX0, scrY0, scrX1, scrY1); diff --git a/core/src/processing/opengl/Texture.java b/core/src/processing/opengl/Texture.java index 5ffd60b0b..3f096b40a 100644 --- a/core/src/processing/opengl/Texture.java +++ b/core/src/processing/opengl/Texture.java @@ -1271,16 +1271,16 @@ public class Texture implements PConstants { if (scale) { // Rendering tex into "this", and scaling the source rectangle // to cover the entire destination region. - pgl.drawTexture(tex.glTarget, tex.glName, - tex.glWidth, tex.glHeight, tempFbo.width, tempFbo.height, + pgl.drawTexture(tex.glTarget, tex.glName, tex.glWidth, tex.glHeight, + 0, 0, tempFbo.width, tempFbo.height, x, y, x + w, y + h, 0, 0, width, height); } else { // Rendering tex into "this" but without scaling so the contents // of the source texture fall in the corresponding texels of the // destination. - pgl.drawTexture(tex.glTarget, tex.glName, - tex.glWidth, tex.glHeight, tempFbo.width, tempFbo.height, + pgl.drawTexture(tex.glTarget, tex.glName, tex.glWidth, tex.glHeight, + 0, 0, tempFbo.width, tempFbo.height, x, y, x + w, y + h, x, y, x + w, y + h); } pg.popFramebuffer(); @@ -1307,16 +1307,16 @@ public class Texture implements PConstants { if (scale) { // Rendering tex into "this", and scaling the source rectangle // to cover the entire destination region. - pgl.drawTexture(texTarget, texName, - texWidth, texHeight, tempFbo.width, tempFbo.height, + pgl.drawTexture(texTarget, texName, texWidth, texHeight, + 0, 0, tempFbo.width, tempFbo.height, x, y, w, h, 0, 0, width, height); } else { // Rendering tex into "this" but without scaling so the contents // of the source texture fall in the corresponding texels of the // destination. - pgl.drawTexture(texTarget, texName, - texWidth, texHeight, tempFbo.width, tempFbo.height, + pgl.drawTexture(texTarget, texName, texWidth, texHeight, + 0, 0, tempFbo.width, tempFbo.height, x, y, w, h, x, y, w, h); } pg.popFramebuffer(); From f26c5cbb57600e34501b7b05a6cccf5e8072720a Mon Sep 17 00:00:00 2001 From: codeanticode Date: Thu, 29 Jan 2015 01:22:41 -0500 Subject: [PATCH 5/7] store label pixels --- core/src/processing/opengl/PGL.java | 84 ++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 9f51b00e2..5fac5e21f 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -613,7 +613,14 @@ public abstract class PGL { texParameteri(TEXTURE_2D, TEXTURE_WRAP_S, CLAMP_TO_EDGE); texParameteri(TEXTURE_2D, TEXTURE_WRAP_T, CLAMP_TO_EDGE); texImage2D(TEXTURE_2D, 0, RGBA, 100, 50, 0, RGBA, UNSIGNED_BYTE, null); - initTexture(TEXTURE_2D, RGBA, 100, 50, pg.backgroundColor); +// initTexture(TEXTURE_2D, RGBA, 100, 50, pg.backgroundColor); + + ByteBuffer bb = ByteBuffer.allocateDirect(labelPix.length*4); + bb.order(ByteOrder.nativeOrder()); + IntBuffer ib = bb.asIntBuffer(); + ib.put(labelPix); + ib.position(0); + copyToTexture(TEXTURE_2D, RGBA, labelTex.get(0), 0, 0, 100, 50, ib); bindTexture(TEXTURE_2D, 0); } drawTexture(TEXTURE_2D, labelTex.get(0), 100, 50, @@ -932,6 +939,12 @@ public abstract class PGL { } + protected void copyToTexture(int target, int format, int id, int x, int y, + int w, int h, int[] buffer) { + copyToTexture(target, format, id, x, y, w, h, IntBuffer.wrap(buffer)); + + } + protected void copyToTexture(int target, int format, int id, int x, int y, int w, int h, IntBuffer buffer) { activeTexture(TEXTURE0); @@ -2837,4 +2850,73 @@ public abstract class PGL { public abstract void renderbufferStorageMultisample(int target, int samples, int format, int width, int height); public abstract void readBuffer(int buf); public abstract void drawBuffer(int buf); + + // Label pixels + + int[] labelPix = {-2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -1315861, -2171170, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -1118482, -1, -2105377, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -1052689, -1, -2105377, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2039584, -855310, -263173, -131587, -460552, -1315861, -2236963, -2236963, -1052689, -263173, -1, -460552, -1118482, -2236963, -2236963, -1776412, -657931, -197380, -197380, -723724, +-1907998, -2236963, -2236963, -2236963, -789517, -1118482, -1447447, -460552, -197380, -789517, -1710619, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-526345, -131587, -921103, -1250068, -592138, -1, -1184275, -2236963, -1447447, -526345, -1, -1052689, -1513240, -2236963, -1710619, -1, -328966, -1184275, -1118482, -263173, -65794, -1776412, -2236963, -2236963, -394759, -263173, -65794, -1118482, -1381654, -394759, -131587, -1907998, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2039584, -1, -1184275, -2236963, -2236963, -2236963, -460552, -723724, -2236963, -2236963, -1052689, -1, -2105377, -2236963, -2171170, -328966, -263173, -2105377, -2236963, -2236963, -2039584, -197380, -460552, -2236963, -2236963, -394759, -1, -1513240, -2236963, -2236963, -2105377, -197380, -526345, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2171170, -65794, -394759, -1710619, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -1052689, -1, -2105377, -2236963, -1907998, -1, -1184275, -2236963, -2236963, -2236963, -2236963, -1052689, -1, -1973791, -2236963, -394759, -328966, -2236963, -2236963, -2236963, -2236963, -1052689, -65794, -2171170, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -1250068, -1, -1, -197380, -855310, -1579033, -2236963, -2236963, -2236963, -1052689, -1, -2105377, -2236963, -1579033, -1, -1579033, -2236963, -2236963, -2236963, -2236963, +-1447447, -1, -1644826, -2236963, -394759, -657931, -2236963, -2236963, -2236963, -2236963, -1381654, -1, -1842205, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -1776412, -986896, -328966, -1, -1, -855310, -2236963, -2236963, -1052689, -1, -2105377, -2236963, -1447447, -1, -1644826, -2236963, -2236963, -2236963, -2236963, -1513240, -1, -1579033, -2236963, -394759, -789517, -2236963, -2236963, -2236963, -2236963, -1381654, -1, -1776412, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2105377, -2171170, -2236963, -2236963, -1907998, -460552, -1, -1973791, -2236963, -1052689, -1, -2105377, -2236963, -1776412, -1, -1381654, -2236963, -2236963, -2236963, -2236963, -1184275, -1, -1776412, -2236963, -394759, -526345, -2236963, -2236963, -2236963, -2236963, -1118482, -65794, -2171170, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -1776412, -1, -1250068, -2236963, -2236963, -2236963, -1250068, -1, -1776412, -2236963, -1118482, -1, -2039584, -2236963, -2105377, -131587, -460552, -2236963, -2236963, -2236963, -2236963, -328966, -131587, -2171170, -2236963, -394759, -1, -1907998, -2236963, -2236963, -2236963, -328966, -394759, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -592138, -197380, -1250068, -1842205, -1381654, -263173, -263173, -2236963, -2236963, -1250068, -1, -921103, -1579033, -2236963, -1250068, -1, -789517, -1776412, -1776412, -657931, +-1, -1513240, -2236963, -2236963, -394759, -1, -394759, -1644826, -1776412, -723724, -65794, -1776412, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-1842205, -460552, -1, -1, -1, -526345, -1973791, -2236963, -2236963, -2039584, -394759, -1, -460552, -2236963, -2236963, -1315861, -131587, -1, -1, -394759, -1447447, -2236963, -2236963, -2236963, -394759, -460552, -855310, -1, -1, -394759, -1513240, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2039584, -1842205, -2171170, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2105377, -2171170, -2236963, -2236963, -2236963, -2236963, -1973791, -2039584, -2236963, -2236963, -2236963, -2236963, -2236963, -394759, -526345, -2236963, -2105377, -1973791, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -394759, -526345, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -394759, -526345, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -1184275, -1250068, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, +-2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963, -2236963 + }; + } From 90920df8825c0ed289d79a8016988e139c426773 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Thu, 29 Jan 2015 01:26:55 -0500 Subject: [PATCH 6/7] use allocateIntBuffer method, fixes all allocate buffer methods --- core/src/processing/opengl/PGL.java | 34 ++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 5fac5e21f..0227463b0 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -615,12 +615,14 @@ public abstract class PGL { texImage2D(TEXTURE_2D, 0, RGBA, 100, 50, 0, RGBA, UNSIGNED_BYTE, null); // initTexture(TEXTURE_2D, RGBA, 100, 50, pg.backgroundColor); - ByteBuffer bb = ByteBuffer.allocateDirect(labelPix.length*4); - bb.order(ByteOrder.nativeOrder()); - IntBuffer ib = bb.asIntBuffer(); - ib.put(labelPix); - ib.position(0); - copyToTexture(TEXTURE_2D, RGBA, labelTex.get(0), 0, 0, 100, 50, ib); +// ByteBuffer bb = ByteBuffer.allocateDirect(labelPix.length*4); +// bb.order(ByteOrder.nativeOrder()); +// IntBuffer ib = bb.asIntBuffer(); +// ib.put(labelPix); +// ib.position(0); + + IntBuffer buf = allocateIntBuffer(labelPix); + copyToTexture(TEXTURE_2D, RGBA, labelTex.get(0), 0, 0, 100, 50, buf); bindTexture(TEXTURE_2D, 0); } drawTexture(TEXTURE_2D, labelTex.get(0), 100, 50, @@ -1854,7 +1856,10 @@ public abstract class PGL { protected static ByteBuffer allocateByteBuffer(byte[] arr) { if (USE_DIRECT_BUFFERS) { - return allocateDirectByteBuffer(arr.length); + ByteBuffer buf = allocateDirectByteBuffer(arr.length); + buf.put(arr); + buf.position(0); + return buf; } else { return ByteBuffer.wrap(arr); } @@ -1943,7 +1948,10 @@ public abstract class PGL { protected static ShortBuffer allocateShortBuffer(short[] arr) { if (USE_DIRECT_BUFFERS) { - return allocateDirectShortBuffer(arr.length); + ShortBuffer buf = allocateDirectShortBuffer(arr.length); + buf.put(arr); + buf.position(0); + return buf; } else { return ShortBuffer.wrap(arr); } @@ -2032,7 +2040,10 @@ public abstract class PGL { protected static IntBuffer allocateIntBuffer(int[] arr) { if (USE_DIRECT_BUFFERS) { - return allocateDirectIntBuffer(arr.length); + IntBuffer buf = allocateDirectIntBuffer(arr.length); + buf.put(arr); + buf.position(0); + return buf; } else { return IntBuffer.wrap(arr); } @@ -2120,7 +2131,10 @@ public abstract class PGL { protected static FloatBuffer allocateFloatBuffer(float[] arr) { if (USE_DIRECT_BUFFERS) { - return allocateDirectFloatBuffer(arr.length); + FloatBuffer buf = allocateDirectFloatBuffer(arr.length); + buf.put(arr); + buf.position(0); + return buf; } else { return FloatBuffer.wrap(arr); } From 0b941e1612c464995946f76ecad4d857b8b14214 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Thu, 29 Jan 2015 01:30:07 -0500 Subject: [PATCH 7/7] invert Y --- core/src/processing/opengl/PGL.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index 0227463b0..9c790c44b 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -627,7 +627,7 @@ public abstract class PGL { } drawTexture(TEXTURE_2D, labelTex.get(0), 100, 50, 0, 0, 20 + 100, 20 + 50, - 0, 0, 100, 50, + 0, 50, 100, 0, 20, 20, 20 + 100, 20 + 50); /*