View | Details | Raw Unified | Return to bug 1101
Collapse All | Expand All

(-)a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java (-3 / +15 lines)
Lines 42-48 package com.jogamp.opengl.util.awt; Link Here
42
import com.jogamp.common.nio.Buffers;
42
import com.jogamp.common.nio.Buffers;
43
import com.jogamp.common.util.InterruptSource;
43
import com.jogamp.common.util.InterruptSource;
44
import com.jogamp.common.util.PropertyAccess;
44
import com.jogamp.common.util.PropertyAccess;
45
import com.jogamp.opengl.GLExtensions;
46
import com.jogamp.opengl.util.*;
45
import com.jogamp.opengl.util.*;
47
import com.jogamp.opengl.util.packrect.*;
46
import com.jogamp.opengl.util.packrect.*;
48
import com.jogamp.opengl.util.texture.*;
47
import com.jogamp.opengl.util.texture.*;
Lines 566-571 public class TextRenderer { Link Here
566
        @throws GLException If an OpenGL context is not current when this method is called
565
        @throws GLException If an OpenGL context is not current when this method is called
567
    */
566
    */
568
    public void dispose() throws GLException {
567
    public void dispose() throws GLException {
568
        if( null != mPipelinedQuadRenderer ) {
569
            mPipelinedQuadRenderer.dispose();
570
        }
569
        packer.dispose();
571
        packer.dispose();
570
        packer = null;
572
        packer = null;
571
        cachedBackingStore = null;
573
        cachedBackingStore = null;
Lines 1862-1868 public class TextRenderer { Link Here
1862
                    gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, mTexCoords);
1864
                    gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, mTexCoords);
1863
                }
1865
                }
1864
1866
1865
                gl.glDrawArrays(GL2GL3.GL_QUADS, 0,
1867
                gl.glDrawArrays(GL2ES3.GL_QUADS, 0,
1866
                                mOutstandingGlyphsVerticesPipeline);
1868
                                mOutstandingGlyphsVerticesPipeline);
1867
1869
1868
                mVertCoords.rewind();
1870
                mVertCoords.rewind();
Lines 1877-1883 public class TextRenderer { Link Here
1877
                renderer.getTexture(); // triggers texture uploads.  Maybe this should be more obvious?
1879
                renderer.getTexture(); // triggers texture uploads.  Maybe this should be more obvious?
1878
1880
1879
                final GL2 gl = GLContext.getCurrentGL().getGL2();
1881
                final GL2 gl = GLContext.getCurrentGL().getGL2();
1880
                gl.glBegin(GL2GL3.GL_QUADS);
1882
                gl.glBegin(GL2ES3.GL_QUADS);
1881
1883
1882
                try {
1884
                try {
1883
                    final int numberOfQuads = mOutstandingGlyphsVerticesPipeline / 4;
1885
                    final int numberOfQuads = mOutstandingGlyphsVerticesPipeline / 4;
Lines 1911-1916 public class TextRenderer { Link Here
1911
                }
1913
                }
1912
            }
1914
            }
1913
        }
1915
        }
1916
1917
		public void dispose() {
1918
		    final GL2 gl = GLContext.getCurrentGL().getGL2();
1919
		    final int[] vbos = new int[2];
1920
		    vbos[0] = mVBO_For_ResuableTileVertices;
1921
		    vbos[1] = mVBO_For_ResuableTileTexCoords;
1922
		    gl.glDeleteBuffers(2, IntBuffer.wrap(vbos));
1923
		}
1914
    }
1924
    }
1915
1925
1916
    class DebugListener implements GLEventListener {
1926
    class DebugListener implements GLEventListener {
Lines 1950-1955 public class TextRenderer { Link Here
1950
1960
1951
        @Override
1961
        @Override
1952
        public void dispose(final GLAutoDrawable drawable) {
1962
        public void dispose(final GLAutoDrawable drawable) {
1963
            mPipelinedQuadRenderer.dispose();
1964
            // n/a glu.destroy(); ??
1953
            glu=null;
1965
            glu=null;
1954
            frame=null;
1966
            frame=null;
1955
        }
1967
        }

Return to bug 1101