<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>354</bug_id>
          
          <creation_ts>2008-04-15 04:28:20 +0200</creation_ts>
          <short_desc>Inclusion of a GLCanvas in a JFrame causes exception</short_desc>
          <delta_ts>2010-03-24 07:51:26 +0100</delta_ts>
          <reporter_accessible>0</reporter_accessible>
          <cclist_accessible>0</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>1</version>
          <rep_platform>All</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>370</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2010-03-24 07:51:26 +0100</bug_when>
    <thetext>


---- Reported by esalbert 2008-04-15 16:28:20 ----

When trying to compile a simple test program (just draws a triangle),

&lt;pre&gt;
package test;

import java.awt.BorderLayout;
import javax.media.opengl.*;
import javax.swing.*;

public class SimpleTest implements GLEventListener
{
  public SimpleTest() { super(); }

  public void init(GLAutoDrawable drw)
  {
    drw.setGL(new DebugGL(drw.getGL()));
    GL gl = drw.getGL();

    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    gl.glLoadIdentity();
  } // init

  public void display(GLAutoDrawable drw)
  {
    GL gl = drw.getGL();

    gl.glColor3f(1.0F, 0.4F, 0.0F);

    gl.glBegin(GL.GL_TRIANGLES);
      gl.glVertex3f(0.0F, 0.0F, 0.0F);
      gl.glVertex3f(1.0F, 0.0F, 0.0F);
      gl.glVertex3f(1.0F, 1.0F, 0.0F);
    gl.glEnd();
  } // display

  public void reshape(GLAutoDrawable drw, int x, int y, int wid, int hite)
  {
  } // reshape

  public void displayChanged(GLAutoDrawable drw, boolean modeCh, boolean devCh)
  {
  } // displayChanged

  public static void main(String[] argv)
  {
    GLCapabilities glCaps = new GLCapabilities();

    // This line fails with the current (1.1.1.1-rc8 - February 22) build,
    // but works if GLCanvas is changed to GLJPanel.  With the 1.1.0
    // release build, it works either way.  When it fails, the JFrame, when
    // first made visible, crashes with an IllegalArgumentException deep
    // inside the GL class heirarchy.
    GLCanvas canv = new GLCanvas(glCaps);

    final JFrame fram = new JFrame(&quot;TestFrame&quot;);
    fram.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    fram.setSize(640, 480);
    fram.getContentPane().add(canv, BorderLayout.CENTER);
    canv.addGLEventListener(new SimpleTest());
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        fram.setVisible(true);
      } // run
    });
  } // main
} // SimpleTest
&lt;/pre&gt;

I get the following exception if I use a GLCanvas:

&lt;pre&gt;
Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.RuntimeException:
java.lang.IllegalArgumentException: 

argument type mismatch
        at
com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:86)
        at
com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.platformInfo(JAWT_DrawingSurfaceInfo.java:52)
        at 

com.sun.opengl.impl.windows.WindowsOnscreenGLDrawable.lockSurface(WindowsOnscreenGLDrawable.java:189)
        at 

com.sun.opengl.impl.windows.WindowsOnscreenGLContext.makeCurrentImpl(WindowsOnscreenGLContext.java:57)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at
javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:412)
        at javax.media.opengl.GLCanvas.display(GLCanvas.java:244)
        at javax.media.opengl.GLCanvas.paint(GLCanvas.java:277)
        at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
        at sun.awt.RepaintArea.paint(RepaintArea.java:224)
        at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:301)
        at java.awt.Component.dispatchEventImpl(Component.java:4486)
        at java.awt.Component.dispatchEvent(Component.java:4240)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:83)
        ... 20 more
&lt;/pre&gt;

If I change &quot;GLCanvas&quot; to &quot;GLJPanel&quot; on the indicated line, it runs correctly. 
Using the 1.1.0 release versions of the libraries, it worked either way.

Please let me know if I need to provide any more information.  The machine is a
Dell Precision PWS390 computer running Windows XP Professional with a Core 2 CPU
and 2 GB of RAM.  I did set the &quot;-Dsun.java2d.noddraw=true&quot; flag.

Thank you for considering this matter.

Eric Salberta



---- Additional Comments From esalbert 2008-04-15 16:29:47 ----

Created an attachment
The source file which shows the problem.




---- Additional Comments From kbr 2008-04-16 22:45:15 ----

Without having time to run this test I can tell you with 99.9% certainty that
you have a mismatched jogl.dll and jogl.jar. Please clean all such files off
your system and download a fresh copy of JOGL. Please reopen this bug if the
problem persists.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:51 EDT  ---

This bug was previously known as _bug_ 354 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=354
Imported an attachment (id=125)

The original submitter of attachment 125 is unknown.
   Reassigning to the person who moved it here: sgothel@jausoft.com.

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>125</attachid>
            <date>2008-04-15 16:29:00 +0200</date>
            <delta_ts>2008-04-15 16:29:00 +0200</delta_ts>
            <desc>The source file which shows the problem.</desc>
            <filename>SimpleTest.java</filename>
            <type>text/plain</type>
            <size>1832</size>
            <attacher name="Sven Gothel">sgothel</attacher>
            
              <data encoding="base64">cGFja2FnZSB0ZXN0Ow0KDQppbXBvcnQgamF2YS5hd3QuQm9yZGVyTGF5b3V0Ow0KaW1wb3J0IGph
dmF4Lm1lZGlhLm9wZW5nbC4qOw0KaW1wb3J0IGphdmF4LnN3aW5nLio7DQoNCnB1YmxpYyBjbGFz
cyBTaW1wbGVUZXN0IGltcGxlbWVudHMgR0xFdmVudExpc3RlbmVyDQp7DQogIHB1YmxpYyBTaW1w
bGVUZXN0KCkgeyBzdXBlcigpOyB9DQoNCiAgcHVibGljIHZvaWQgaW5pdChHTEF1dG9EcmF3YWJs
ZSBkcncpDQogIHsNCiAgICBkcncuc2V0R0wobmV3IERlYnVnR0woZHJ3LmdldEdMKCkpKTsNCiAg
ICBHTCB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