Both on their own are running smooth without problems. But combining them in the way above ends in a java.lang.OutOfMemoryError.
I thought setting theMainMenu to null would tell the Garbagecollection to recycle this object (and the objects inside it).
I even tried to wait a few seconds after nulling the mainmenu before creating the mainsketch object…
Is there another way to tell the VM: "this object is no longer needed, let's recycle it and clear the ram?"
I'm building a cross-platform game using Processing.
I'm using scale() to zoom in on the map. On Mac and Windows it works fine.
On Android everything is pixelating… Is there a way to antialiase the whole thing?
Here's a screenshot:
Edit: smooth() is doing nothing at all and changing the renderer to P3D or OPENGL throws an out-of-memory error…
I stumbled upon an interesting thing today: tint() does not work if I use copy() to display a part of an image.
Here's the code I used for testing purposes:
I've made a small android application allowing the user to select a soundfile which plays in the background of the sketch.
Well, I'm using this code:
void loadSoundFile() {
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Audio.Media.EXTERNAL_CONTENT_URI); startActivityForResult(intent,FILE_REQUEST_CODE);
}
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { println("ok"); } else { println("damn - its not working"); } }
The file picker successfully launches and I can pick a sound file… But onActivityResult() is not called when returning from an external application (like the Android musiclibrary). If I use an application that just overlays over my sketch (like the WhatsApp soundrecorder) onActivityResult() is called and I can process the returned data. Some guys on Google figured out that it might be a problem with Processing running as an Activity - not as a Fragment.
Did anyone stumbled upon this problem before? Any solutions?
Thanks in advance.
I'm building a small desktop application in Processing. I needed a second window to show a static image.
Now I want to close that second window from the original applet… I created a method calling exit() that causes the whole application to exit. I tried dispose() that gives me a nullpointexception… How can I close that window without closing the whole application?
I'm using this code I found on the old Processing forum:
PFrame f; secondApplet s;
voidsetup() { size(320, 240); PFrame f = new PFrame(); }