Hello,
I’m using GLJPanel to draw the graphics of my software (Scilab) with or without Java2d OpenGL pipeline enable.
In our team most of us have nvidia cards and text rendering works perfectly. However some of us have laptops with ATI cards and they are unable to draw a single text. Exception are raised and sometime the software crashes.
We tried this piece of code on the following computer (this is the demo TextCube simplified):
public class TestSimone implements GLEventListener {
private GLU glu = new GLU();
private TextRenderer renderer;
public static void main(String[] args) {
Frame frame = new Frame("Text Cube");
frame.setLayout(new BorderLayout());
GLJPanel canvas = new GLJPanel();
final TestSimone demo = new TestSimone();
canvas.addGLEventListener(demo);
frame.add(canvas, BorderLayout.CENTER);
frame.setSize(512, 512);
final Animator animator = new Animator(canvas);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
// Run this on another thread than the AWT event queue to
// make sure the call to Animator.stop() completes before
// exiting
new Thread(new Runnable() {
public void run() {
animator.stop();
System.exit(0);
}
}).start();
}
});
frame.show();
animator.start();
}
public void init(GLAutoDrawable drawable) {
renderer = new TextRenderer(new Font("SansSerif", Font.PLAIN, 12));
}
public void display(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
glu.gluLookAt(0, 0, 10,
0, 0, 0,
0, 1, 0);
gl.glColor3d(1.0,1.0,1.0);
renderer.setColor(1.0f, 1.0f, 1.0f, 1.0f);
renderer.begin3DRendering();
renderer.draw3D("Hello JOGL !!!",
0.0f,0.0f, 0.0f, 0.01f);
renderer.end3DRendering();
}
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
GL gl = drawable.getGL();
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(15, (float) width / (float) height, 5, 15);
}
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
}
Linux distribution : Fedora 7
- kernel version ("uname -a"):
Linux tank 2.6.23.14-64.fc7 #1 SMP Sun Jan 20 23:54:08 EST 2008 i686
i686 i386 GNU/Linux
- graphics card ("/sbin/lspci")
01:00.0 VGA compatible controller: ATI Technologies Inc M56P [Radeon
Mobility X1600]
- graphics driver installed
ATI 8.45.4 (use the Catalyst Control center to recover the information)
- OpenGL support ("glxinfo")
[simone@tank ~]$ glxinfo
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_texture_from_pixmap,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method,
GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_visual_select_group
client glx vendor string: SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_MESA_allocate_memory,
GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control,
GLX_MESA_swap_frame_usage, GLX_OML_swap_method,
GLX_OML_sync_control,
GLX_SGI_make_current_read, GLX_SGI_swap_control,
GLX_SGI_video_sync,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.2
GLX extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample,
GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method,
GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_visual_select_group
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Mobility Radeon X1600
OpenGL version string: 2.1.7276 Release
OpenGL extensions:
GL_AMD_performance_monitor, GL_ARB_depth_texture,
GL_ARB_draw_buffers,
GL_ARB_fragment_program, GL_ARB_fragment_shader,
GL_ARB_multisample,
GL_ARB_multitexture, GL_ARB_occlusion_query,
GL_ARB_pixel_buffer_object,
GL_ARB_point_parameters, GL_ARB_point_sprite,
GL_ARB_shader_objects,
GL_ARB_shading_language_100, GL_ARB_shadow, GL_ARB_shadow_ambient,
GL_ARB_texture_border_clamp, GL_ARB_texture_compression,
GL_ARB_texture_cube_map, GL_ARB_texture_env_add,
GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar,
GL_ARB_texture_env_dot3, GL_ARB_texture_float,
GL_ARB_texture_mirrored_repeat, GL_ARB_texture_rectangle,
GL_ARB_transpose_matrix, GL_ARB_vertex_buffer_object,
GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ARB_window_pos,
GL_ATI_draw_buffers, GL_ATI_envmap_bumpmap, GL_ATI_fragment_shader,
GL_ATI_meminfo, GL_ATI_separate_stencil,
GL_ATI_texture_compression_3dc,
GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_EXT_bgra,
GL_EXT_blend_color, GL_EXT_blend_func_separate,
GL_EXT_blend_minmax,
GL_EXT_blend_subtract, GL_EXT_compiled_vertex_array,
GL_EXT_copy_texture,
GL_EXT_draw_range_elements, GL_EXT_fog_coord,
GL_EXT_framebuffer_object,
GL_EXT_gpu_program_parameters, GL_EXT_multi_draw_arrays,
GL_EXT_packed_depth_stencil, GL_EXT_packed_pixels,
GL_EXT_point_parameters, GL_EXT_rescale_normal,
GL_EXT_secondary_color,
GL_EXT_separate_specular_color, GL_EXT_shadow_funcs,
GL_EXT_stencil_wrap,
GL_EXT_subtexture, GL_EXT_texgen_reflection, GL_EXT_texture3D,
GL_EXT_texture_compression_s3tc, GL_EXT_texture_cube_map,
GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias,
GL_EXT_texture_mirror_clamp, GL_EXT_texture_object,
GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_EXT_vertex_array,
GL_KTX_buffer_region, GL_NV_blend_square, GL_NV_texgen_reflection,
GL_SGIS_generate_mipmap, GL_SGIS_texture_edge_clamp,
GL_SGIS_texture_lod,
GL_WIN_swap_hint, WGL_EXT_swap_control
With the GLJPanel we got the excpetion:
Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: Error making context current
at com.sun.opengl.impl.x11.X11GLContext.makeCurrentImpl(X11GLContext.java:141)
at com.sun.opengl.impl.x11.X11OffscreenGLContext.makeCurrentImpl(X11OffscreenGLContext.java:74)
at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
at javax.media.opengl.GLJPanel.paintComponent(GLJPanel.java:661)
at javax.swing.JComponent.paint(JComponent.java:1027)
at javax.swing.JComponent.paintChildren(JComponent.java:864)
at javax.swing.JComponent.paint(JComponent.java:1036)
at javax.swing.JComponent.paintChildren(JComponent.java:864)
at javax.swing.JComponent.paint(JComponent.java:1036)
However, the same code using GLCanvas works perfectly well.
May it come from the ATI drivers?
Thanks for any help,
Jean-Baptiste