Update extension template
This commit is contained in:
@@ -1,14 +1,8 @@
|
|||||||
package;
|
package;
|
||||||
|
|
||||||
#if cpp
|
|
||||||
import cpp.Lib;
|
|
||||||
#elseif neko
|
|
||||||
import neko.Lib;
|
|
||||||
#end
|
|
||||||
|
|
||||||
#if (android && openfl)
|
import lime.system.CFFI;
|
||||||
import openfl.utils.JNI;
|
import lime.system.JNI;
|
||||||
#end
|
|
||||||
|
|
||||||
|
|
||||||
class ::className:: {
|
class ::className:: {
|
||||||
@@ -16,7 +10,7 @@ class ::className:: {
|
|||||||
|
|
||||||
public static function sampleMethod (inputValue:Int):Int {
|
public static function sampleMethod (inputValue:Int):Int {
|
||||||
|
|
||||||
#if (android && openfl)
|
#if android
|
||||||
|
|
||||||
var resultJNI = ::extensionLowerCase::_sample_method_jni(inputValue);
|
var resultJNI = ::extensionLowerCase::_sample_method_jni(inputValue);
|
||||||
var resultNative = ::extensionLowerCase::_sample_method(inputValue);
|
var resultNative = ::extensionLowerCase::_sample_method(inputValue);
|
||||||
@@ -38,9 +32,9 @@ class ::className:: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static var ::extensionLowerCase::_sample_method = Lib.load ("::extensionLowerCase::", "::extensionLowerCase::_sample_method", 1);
|
private static var ::extensionLowerCase::_sample_method = CFFI.load ("::extensionLowerCase::", "::extensionLowerCase::_sample_method", 1);
|
||||||
|
|
||||||
#if (android && openfl)
|
#if android
|
||||||
private static var ::extensionLowerCase::_sample_method_jni = JNI.createStaticMethod ("org.haxe.extension.::className::", "sampleMethod", "(I)I");
|
private static var ::extensionLowerCase::_sample_method_jni = JNI.createStaticMethod ("org.haxe.extension.::className::", "sampleMethod", "(I)I");
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user