using java as scripting language
I am trying to using java as a scripting language in my game engine by envoking the jvm from my native code and having interface back and forth to my engine. I am able to invoke the JVM and call java functions, but I am unable to call a java method that calls a native method from within it. Has anyone ever attempted this before? Is there any articles/resources out there? Any help would be appreciated.
Don''t have any code with me. But yes it''s possible.
One thing to keep in mind in your design, JNI calls are about 10 times slower than native language calls so try to keep the cross language communication to a minimum.
i.e Have c++ call a single java function, that does a lot of java processing, and returns. Rather than have have C++ call a single java function 1000 times a cycle. Java to Java calls = fast, C++ to c++ calls fast. Java to c++ slow(er), c++ to java slow(er).
One thing to keep in mind in your design, JNI calls are about 10 times slower than native language calls so try to keep the cross language communication to a minimum.
i.e Have c++ call a single java function, that does a lot of java processing, and returns. Rather than have have C++ call a single java function 1000 times a cycle. Java to Java calls = fast, C++ to c++ calls fast. Java to c++ slow(er), c++ to java slow(er).
He''s a bad motha - Shut yo mouth.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement