Hi,
I’m seeing corrupted text when using the TextRenderer to draw 3D text. This occurs when I have 2 GLCanvas in a JTabbedPane. More specifically,
- One GLCanvas in a JPanel – text is fine
- Add a second GLCanvas and put both into a JTabbedPane – text on added GLCanvas is fine
- Switch (tab-click) to the first GLCanvas – text is fine
- Switch back to the second GLCanvas – text is corrupted in that GLCanvas.
Running with -Djogl.debug.TextRenderer produces:
javax.media.opengl.GLException: glGetError() returned the following error codes after a call to glBufferSubData(): GL_INVALID_VALUE
at javax.media.opengl.DebugGL.checkGLGetError(DebugGL.java:12715)
at javax.media.opengl.DebugGL.glBufferSubData(DebugGL.java:429)
at com.sun.opengl.util.j2d.TextRenderer$Pipelined_QuadRenderer.drawVertexArrays(TextRenderer.java:1766)
at com.sun.opengl.util.j2d.TextRenderer$Pipelined_QuadRenderer.draw(TextRenderer.java:1745)
at com.sun.opengl.util.j2d.TextRenderer$Pipelined_QuadRenderer.access$000(TextRenderer.java:1687)
at com.sun.opengl.util.j2d.TextRenderer.flushGlyphPipeline(TextRenderer.java:809)
at com.sun.opengl.util.j2d.TextRenderer.endRendering(TextRenderer.java:705)
at com.sun.opengl.util.j2d.TextRenderer.end3DRendering(TextRenderer.java:551)
at anl.mifs.viz3d.VLabel.doDraw(VLabel.java:57)
I’ve tried textRenderer.setUseVertexArrays(false) and I don’t get the exception but I do get corrupted text although rotation or zoom on that scene restores the text.
Moving the GLCanvas into and out of tabs does call GLEventListener.init and reshape, and I recreate the TextRenderer when that happens using:
public void glInit() {
if (textRenderer != null) textRenderer.dispose();
textRenderer = new TextRenderer(new Font(“Helvetica”, Font.BOLD, 14), true);
textRenderer.setUseVertexArrays(useVertArrays);
}
The TextRenderer is shared among GLCanvas. Perhaps I should create per-canvas instances?
This is on OSX 1.5.7 with an NVIDIA GeForce 7300GT and the latest release version of jogl.
thanks,
Nick