Merge pull request #3864 from JakubValtar/opengl-mem-leak

Keep only references to primary PGL
This commit is contained in:
codeanticode
2015-09-25 11:07:58 -03:00
@@ -777,7 +777,7 @@ public class PGraphicsOpenGL extends PGraphics {
drainRefQueueBounded();
this.pgl = tex.pgl;
this.pgl = tex.pg.getPrimaryPGL();
pgl.genTextures(1, intBuffer);
tex.glName = intBuffer.get(0);
@@ -853,7 +853,7 @@ public class PGraphicsOpenGL extends PGraphics {
drainRefQueueBounded();
this.pgl = vbo.pgl;
this.pgl = vbo.pgl.graphics.getPrimaryPGL();
pgl.genBuffers(1, intBuffer);
vbo.glId = intBuffer.get(0);
@@ -931,7 +931,7 @@ public class PGraphicsOpenGL extends PGraphics {
drainRefQueueBounded();
this.pgl = sh.pgl;
this.pgl = sh.pgl.graphics.getPrimaryPGL();
sh.glProgram = pgl.createProgram();
sh.glVertex = pgl.createShader(PGL.VERTEX_SHADER);
sh.glFragment = pgl.createShader(PGL.FRAGMENT_SHADER);
@@ -1025,7 +1025,7 @@ public class PGraphicsOpenGL extends PGraphics {
drainRefQueueBounded();
this.pgl = fb.pgl;
this.pgl = fb.pg.getPrimaryPGL();
if (!fb.screenFb) {
pgl.genFramebuffers(1, intBuffer);