fix surface init on Android

This commit is contained in:
Nick Fisher
2023-09-27 14:21:53 +08:00
parent 908c76d6c3
commit 93cb9a1307
3 changed files with 126 additions and 145 deletions

View File

@@ -3,24 +3,11 @@
extern "C" {
#include "PolyvoxFilamentApi.h"
const void* create_filament_viewer_android(
jobject surface, JNIEnv* env, ResourceLoaderWrapper* loaderWrapper
) {
ANativeWindow* window = ANativeWindow_fromSurface(env, surface);
return create_filament_viewer(window,loaderWrapper);
}
void create_swap_chain_android(
const void* const viewer,
void* get_native_window_from_surface(
jobject surface,
JNIEnv* env,
uint32_t width,
uint32_t height
JNIEnv* env
) {
ANativeWindow* window = ANativeWindow_fromSurface(env, surface);
create_swap_chain(viewer, window, width, height);
return ANativeWindow_fromSurface(env, surface);
}
}