If you run the example in Debug mode and check the Debug in Eclipse you will see that it creates a new thread per frame, it seems to dump the old one, but still, creating a new thread.
When running the sketch for about 12 hours it crashes with an "Invalid memory access of location" on a thread called "Thread 2683867", which is the thread count it has reached.
I've checked the source code of GSVideo and it doesn't create any new threads anywhere in there. Is it an issue with gstreamer?
Topic says it all really. If I do size(500, 500); registerMethod("keyEvent" ...) works, but not when I do size(500, 500, OPENGL); or size(500, 500, P3D);.
I see a lot of people doing calculations in the draw method, which in some cases is necessary (when working on opengl textures etc.), but in most it can be avoided and usually only slows down the drawing thread.
I thought I'd share how I make a separate thread to handle the calculations.
I have a class called CalculationThread which looks like this:
Sat down a couple of hours yesterday and created a library with the old PGraphics3D.java which hopefully enables people with no OPENGL graphic card to still use Processing 2.
I can't test it myself since I have an OPENGL graphic card but please go ahead and try it out and I'll try and fix the issues that arrise.
I need to use Swing or AWT GUI controllers for a project but still use the OPENGL renderer. Has anyone got that to work? I've read somewhere that it can be done with JOGL2.
I get it to work with a normal renderer, but as soon as I use OPENGL the components end up behind the scene.
I'm using the jogl-files from the Processing 2.0 package. This is what I got so far, that isn't working.
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import processing.core.PApplet;
public class Jogl2 extends PApplet implements ActionListener {
/**
*
*/
private static final long serialVersionUID = -2713698961386189021L;
this is probably just a stupid question, but I can't seem to get it right.
When compiling my Processing sketch it adds the data folder to the exported .app or .exe, this works fine when I use methods such as loadStrings, loadImage, loadFont, but when I use new File("data/filename.xml") it doesn't find the file in the compiled version.
Is there a way to use a relative path to the files when using new File?
I've encountered quiet a big problem... Here's the deal. We started working on a project in the Processing IDE a couple of months back, we tried playing movies with audio and everything worked fine. After a while when the project became bigger we emerged to the Eclipse environment and changed to GSVideo 64-bit, BUT, we never tried playing movies with audio until now, 2 weeks before deadline.
When playing a movie with audio the application crashes, I get this dialog window.
And here's the crash report.
Process: java [1771]
Path: /usr/bin/java
Identifier: com.apple.javajdk16.cmd
Version: 1.0 (1.0)
Code Type: X86-64 (Native)
Parent Process: eclipse [144]
Date/Time: 2011-09-20 13:40:19.494 +0200
OS Version: Mac OS X 10.7.1 (11B26)
Report Version: 9
Interval Since Last Report: 496373 sec
Crashes Since Last Report: 11
Per-App Interval Since Last Report: 29842 sec
Per-App Crashes Since Last Report: 7
Anonymous UUID: xxx
Crashed Thread: 34
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000013801e1e
I got a quiet big sketch running in Eclipse with GLGraphics and GSVideo. Everything works fine to run from the Eclipse environment.
But when I compile the sketch by "Export" > "Other" > "Mac OS X application bundle", it doesn't add the jnilib files that comes with jogl and GSVideo to the bundle, it only adds the jar-files.
I have linked libgluegen-rt.jnilib, libjogl_awt.jnilib, libjogl_cg.jnilib and libjogl.jnilib to jogl.jar and gluegen-rt.jar in "Java Build Path" > Libraries > Native library location. And same thing with the jnilib files to GSVideo.
I can get it working by rightclicking the compiled bundle and click "Show Package Contents" and go to Contents > Resources > Java and add the jnilib files, but I want to add them when I Export it from Eclipse.
sorry for the topic, but I couldn't figure out how to ask this in short words.
I have an ArrayList with a bunch of PVectors in it. And whenever a new Blob appears (Blob detection) I want to add this to the ArrayList, but only if the blob doesn't intersect with a radius of 20 pixels with a PVector in that ArrayList.
Can anyone hint me in the right direction with some pseudo code? Would appreciate it greatly!