Bugzilla – Attachment 138 Details for
Bug 368
VM-Crash when using TextRenderer in DisplayList on ATI GPU
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Sample program that crashes on the ATI GPU
TextRendererDisplayListDemo.java (text/plain), 2.84 KB, created by
Sven Gothel
on 2009-02-02 07:02:00 CET
(
hide
)
Description:
Sample program that crashes on the ATI GPU
Filename:
MIME Type:
Creator:
Sven Gothel
Created:
2009-02-02 07:02:00 CET
Size:
2.84 KB
patch
obsolete
>/** > * (C) Copyright Softwareschneiderei GmbH, Karlsruhe, Germany > * @author mmv > * @since 02.02.2009 > */ >package com.schneide.ramses.demo; > >import java.awt.Dimension; > >import javax.media.opengl.GL; >import javax.media.opengl.GLAutoDrawable; >import javax.media.opengl.GLEventListener; >import javax.media.opengl.GLJPanel; >import javax.swing.JFrame; >import javax.swing.WindowConstants; > >import com.sun.opengl.util.Animator; >import com.sun.opengl.util.j2d.TextRenderer; > >public class TextRendererDisplayListDemo extends JFrame implements GLEventListener { > > private static final long serialVersionUID = -57945727447508397L; > private GLJPanel glpanel; > private Animator animator; > private TextRenderer textRenderer; > private int displayList; > > public TextRendererDisplayListDemo() { > super("TextRendererDisplayListDemo"); //$NON-NLS-1$ > setMinimumSize(new Dimension(600, 500)); > this.glpanel = new GLJPanel(); > this.glpanel.setSize(400, 400); > this.glpanel.addGLEventListener(this); > this.animator = new Animator(this.glpanel); > getContentPane().add(this.glpanel); > setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); > } > > @Override > public void display(GLAutoDrawable drawable) { > drawable.getGL().glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); > drawable.getGL().glLoadIdentity(); > paintText(drawable, 100, 100); > drawable.getGL().glCallList(this.displayList); > } > > private void paintText(GLAutoDrawable drawable, int x, int y) { > this.textRenderer.beginRendering(drawable.getWidth(), drawable.getHeight()); > this.textRenderer.setColor(1.0f, 0.2f, 0.2f, 0.8f); > this.textRenderer.draw("Text to draw", x, y); //$NON-NLS-1$ > this.textRenderer.endRendering(); > } > > @Override > public void displayChanged(GLAutoDrawable gl, boolean arg1, boolean arg2) { > // do nothing > } > > @Override > public void init(GLAutoDrawable drawable) { > GL gl = drawable.getGL(); > gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); > if (null != this.textRenderer) { > this.textRenderer.dispose(); > } > this.textRenderer = new TextRenderer(getFont()); > if (0 != this.displayList) { > gl.glDeleteLists(this.displayList, 1); > } > this.displayList = gl.glGenLists(1); > gl.glNewList(this.displayList, GL.GL_COMPILE); > paintText(drawable, 200, 200); > gl.glEndList(); > } > > @Override > public void reshape(GLAutoDrawable gl, int arg1, int arg2, int arg3, int arg4) { > // do nothing > } > > public static void main(String[] args) { > TextRendererDisplayListDemo demo = new TextRendererDisplayListDemo(); > demo.setVisible(true); > demo.animator.start(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 368
: 138