We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › OpenGL in a Java Desktop Application (Netbeans)
Page Index Toggle Pages: 1
OpenGL in a Java Desktop Application (Netbeans) (Read 1696 times)
OpenGL in a Java Desktop Application (Netbeans)
Aug 9th, 2009, 12:24pm
 
Hi there,

I have an issue while integrating my PApplet using OpenGL in a new Java Desktop Application generated by Netbeans. Indeed, sometimes my PApplet is displayed properly, but sometimes it is also displayed black with my testing shape rendered in a strange way at the bottom left of the applet.

Here is a screenshot: h t t p : / / img185.imageshack.us/my.php?image=capturei.png

And here is my code:
Code:
public class TestView extends FrameView {

   public TestView(SingleFrameApplication app) {
       super(app);

       initComponents();

       …

       Preview p = new Preview();
       mainPanel.add(p);
       p.init();
   }


Code:
package test;

import processing.core.*;
import processing.opengl.*;

class Preview extends PApplet {

   @Override
   public void setup() {
       size(500,500,OPENGL);
   }

   @Override
   public void draw() {
       ellipse(100,100,20,20);
   }
}


I downloaded JOGL from its official website and I added the two JARs gluegen-rt.jar and jogl.jar to my project.

You can get the whole source code of this testing project here: h t t p : / / w w w.megaupload.com/?d=2TWPDWEZ

Am I doing anything wrong? Using the JAVA2D default renderer it works fine.

Thanks in advance for any help!
Re: OpenGL in a Java Desktop Application (Netbeans)
Reply #1 - Aug 11th, 2009, 6:38am
 
According to a friend, this issue does not appear while the application is running on Windows. In fact I was running it on Ubuntu Linux, and I'm suspecting the NVIDIA display drivers.

Please could you test the given project on your system, especially if you're using Linux or another UNIX system? Cheers!
Re: OpenGL in a Java Desktop Application (Netbeans)
Reply #2 - Aug 11th, 2009, 2:33pm
 
looks fine here (after i worked out how to stop it using the 64 bit jogl libraries...)

Fedora9 (32 bit) nVidia 173.14.15 (GeForce GO 7300)
Page Index Toggle Pages: 1