GLJPanel Questions ?

I am very new to this JOGL .
I am runing on linux os and JDK1.4
in JGears.java demo ,
if (javaImage != null) {
g.drawImage(javaImage, sp, getHeight() - javaImage.getHeight() - sp, null);

  if (openglImage != null) {
             g.drawImage(openglImage, sp, getHeight() - openglImage.getHeight() - sp, null);
  }
  1. This is normal java 2D software rendering .Why two javaImage and openglImage required when both are draw using drawImage?.
  2. How GLJPanel will enable openGL image rendering ?I looked at paintComponent but didn’t get much information.
  3. I commented the paintComponent of GLJPanel but still able to draw the images ?Just wanted to know how
    openGL accelartion is performed ?
  4. Is there any demo which will comapre normal Java 2D image draw and open GL hardware accelarted image draw performance .

The GLJPanel is intended to provide 100% Swing compatibility at the possible expense of performance. The drawing of the icons at the bottom of the Gears demo shows that you can combine OpenGL rendering with Java2D rendering using the GLJPanel. This is not the case with the heavyweight GLCanvas. You shouldn’t need to know all of the internals of the GLJPanel in order to use it; set up a GLEventListener as is done in any of the demos and your OpenGL code should work identically with the GLCanvas or the GLJPanel. There is currently no demo comparing Java2D and OpenGL rendering speed. You will probably not get the best performance using a GLJPanel for this, but if you draw your images using a texture-mapped quadrilateral then on a GLCanvas using OpenGL should be very fast.

Hi Ken Russell
Thx Lot for the info.
Is their any sample code for "draw your images using a texture-mapped quadrilateral then on a GLCanvas using OpenGL should be very fast " . Pls can send me the demo program it will be great help .

Thx Lot

Look for something in Pepijn’s JOGL ports of the NeHe tutorials – http://pepijn.fab4.be/nehe/ .