Is it possible to write processing library in c++ and access it in regular sketch . If it is done like that would it speed up the sketch? and are there any processing libraries that does that?
You can try to use Java's JNI. It's a lot of complicated stuff, and I wouldn't know how well it would work with Processing (since I've never tried this), but if you're up for digging around, here's a link that could get you started: http://www.ibm.com/developerworks/java/tutorials/j-jni/j-jni.html
JNI or JNA.
But for pure algorithm, Java's JIT compiler might perform better than compiled C++, in some cases...
That said, in general, the bottleneck is in the display itself, which can be solved by using OpenGL, shaders, etc.
Answers
http://www.OpenFrameworks.cc/
yes i do know about open frame works but what i am asking is writing part of the code in c++ (like libraries etc..) not all of it in processing.
You can try to use Java's JNI. It's a lot of complicated stuff, and I wouldn't know how well it would work with Processing (since I've never tried this), but if you're up for digging around, here's a link that could get you started: http://www.ibm.com/developerworks/java/tutorials/j-jni/j-jni.html
native
calls is the standard way for Java to access code compiled in other programming languages.JNI or JNA.
But for pure algorithm, Java's JIT compiler might perform better than compiled C++, in some cases...
That said, in general, the bottleneck is in the display itself, which can be solved by using OpenGL, shaders, etc.