rename Android C++ glue file

This commit is contained in:
Nick Fisher
2024-06-06 22:10:56 +08:00
parent 6ad53ae413
commit dda9a61f20
2 changed files with 31 additions and 21 deletions

View File

@@ -1,21 +0,0 @@
#include <android/native_window_jni.h>
#include <android/native_activity.h>
extern "C" {
#include "FlutterFilamentFFIApi.h"
void* get_native_window_from_surface(
jobject surface,
JNIEnv* env
) {
void* window = ANativeWindow_fromSurface(env, surface);
return window;
}
// this does nothing, but we need it for JNA to return the correct pointer
FilamentRenderCallback make_render_callback_fn_pointer(FilamentRenderCallback callback) {
return callback;
}
}

View File

@@ -0,0 +1,31 @@
#include <android/native_window_jni.h>
#include <android/native_activity.h>
#include "DartFilamentFFIApi.h"
extern "C" {
void* get_native_window_from_surface(
jobject surface,
JNIEnv* env
) {
void* window = ANativeWindow_fromSurface(env, surface);
return window;
}
ResourceLoaderWrapper* make_resource_loader_wrapper_android(LoadFilamentResourceFromOwner loadFn, FreeFilamentResourceFromOwner freeFn, void* owner) {
ResourceLoaderWrapper *rlw = (ResourceLoaderWrapper *)malloc(sizeof(ResourceLoaderWrapper));
rlw->loadToOut = nullptr;
rlw->freeResource = nullptr;
rlw->loadResource = nullptr;
rlw->loadFromOwner = loadFn;
rlw->freeFromOwner = freeFn;
rlw->owner = owner;
return rlw;
}
// this does nothing, but we need it for JNA to return the correct pointer
FilamentRenderCallback make_render_callback_fn_pointer(FilamentRenderCallback callback) {
return callback;
}
}