rename plugin from PolyvoxFilament to FlutterFilament

rename plugin from PolyvoxFilament to FlutterFilament
This commit is contained in:
Nick Fisher
2023-10-26 14:05:03 +11:00
parent b42d31a773
commit 8b9e6a2b3a
125 changed files with 1539 additions and 1460 deletions

View File

@@ -1,7 +1,7 @@
import FlutterMacOS
import GLKit
public class SwiftPolyvoxFilamentPlugin: NSObject, FlutterPlugin, FlutterTexture {
public class SwiftFlutterFilamentPlugin: NSObject, FlutterPlugin, FlutterTexture {
var registrar : FlutterPluginRegistrar
var flutterTextureId: Int64?
@@ -23,7 +23,7 @@ public class SwiftPolyvoxFilamentPlugin: NSObject, FlutterPlugin, FlutterTexture
var loadResource : @convention(c) (UnsafePointer<Int8>?, UnsafeMutableRawPointer?) -> ResourceBuffer = { uri, resourcesPtr in
let instance:SwiftPolyvoxFilamentPlugin = Unmanaged<SwiftPolyvoxFilamentPlugin>.fromOpaque(resourcesPtr!).takeUnretainedValue()
let instance:SwiftFlutterFilamentPlugin = Unmanaged<SwiftFlutterFilamentPlugin>.fromOpaque(resourcesPtr!).takeUnretainedValue()
var uriString = String(cString:uri!)
@@ -58,12 +58,12 @@ public class SwiftPolyvoxFilamentPlugin: NSObject, FlutterPlugin, FlutterTexture
}
var freeResource : @convention(c) (ResourceBuffer,UnsafeMutableRawPointer?) -> () = { rbuf, resourcesPtr in
let instance:SwiftPolyvoxFilamentPlugin = Unmanaged<SwiftPolyvoxFilamentPlugin>.fromOpaque(resourcesPtr!).takeUnretainedValue()
let instance:SwiftFlutterFilamentPlugin = Unmanaged<SwiftFlutterFilamentPlugin>.fromOpaque(resourcesPtr!).takeUnretainedValue()
instance.resources.removeValue(forKey:UInt32(rbuf.id))
}
var markTextureFrameAvailable : @convention(c) (UnsafeMutableRawPointer?) -> () = { instancePtr in
let instance:SwiftPolyvoxFilamentPlugin = Unmanaged<SwiftPolyvoxFilamentPlugin>.fromOpaque(instancePtr!).takeUnretainedValue()
let instance:SwiftFlutterFilamentPlugin = Unmanaged<SwiftFlutterFilamentPlugin>.fromOpaque(instancePtr!).takeUnretainedValue()
if(instance.flutterTextureId != nil) {
instance.registry.textureFrameAvailable(instance.flutterTextureId!)
}
@@ -84,7 +84,7 @@ public class SwiftPolyvoxFilamentPlugin: NSObject, FlutterPlugin, FlutterTexture
let _messenger = registrar.messenger;
messenger = _messenger;
let channel = FlutterMethodChannel(name: "app.polyvox.filament/event", binaryMessenger: _messenger)
let instance = SwiftPolyvoxFilamentPlugin(textureRegistry: registrar.textures, registrar:registrar)
let instance = SwiftFlutterFilamentPlugin(textureRegistry: registrar.textures, registrar:registrar)
registrar.addMethodCallDelegate(instance, channel: channel)
}

View File

@@ -1,9 +1,9 @@
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint polyvox_filament.podspec` to validate before publishing.
# Run `pod lib lint flutter_filament.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'polyvox_filament'
s.name = 'flutter_filament'
s.version = '0.0.1'
s.summary = 'A new Flutter plugin project.'
s.description = <<-DESC
@@ -15,7 +15,7 @@ A new Flutter plugin project.
s.source = { :path => '.' }
s.source_files = 'Classes/*', 'src/*', "src/camutils/*", 'include/filament/*', 'include/*', 'include/material/*.c'
s.public_header_files = 'include/SwiftPolyvoxFilamentPlugin-Bridging-Header.h', 'include/PolyvoxFilamentApi.h', 'include/PolyvoxFilamentFFIApi.h', 'include/ResourceBuffer.hpp' #, 'include/filament/*'
s.public_header_files = 'include/SwiftFlutterFilamentPlugin-Bridging-Header.h', 'include/FlutterFilamentApi.h', 'include/FlutterFilamentFFIApi.h', 'include/ResourceBuffer.hpp' #, 'include/filament/*'
s.dependency 'FlutterMacOS'
s.platform = :osx, '13'
@@ -24,10 +24,10 @@ A new Flutter plugin project.
# 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
# "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
# 'OTHER_CFLAGS' => '"-fvisibility=default" "$(inherited)"',
# 'USER_HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/../.symlinks/plugins/polyvox_filament/macos/zzzinclude" "${PODS_ROOT}/../.symlinks/plugins/polyvox_filament/macos/src" "${PODS_ROOT}/../.symlinks/plugins/polyvox_filament/macos/src/image" "${PODS_ROOT}/../.symlinks/plugins/polyvox_filament/macos/src/shaders" "$(inherited)"',
# 'USER_HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/../.symlinks/plugins/flutter_filament/macos/zzzinclude" "${PODS_ROOT}/../.symlinks/plugins/flutter_filament/macos/src" "${PODS_ROOT}/../.symlinks/plugins/flutter_filament/macos/src/image" "${PODS_ROOT}/../.symlinks/plugins/flutter_filament/macos/src/shaders" "$(inherited)"',
# 'ALWAYS_SEARCH_USER_PATHS' => 'YES',
# "OTHER_LDFLAGS" => '-lfilament -lbackend -lfilameshio -lviewer -lfilamat -lgeometry -lutils -lfilabridge -lgltfio_core -lfilament-iblprefilter -limage -limageio -ltinyexr -lcamutils -lgltfio_core -lfilaflat -ldracodec -libl -lktxreader -lpng -lpng16 -lz -lstb -luberzlib -lsmol-v -luberarchive -lzstd',
# 'LIBRARY_SEARCH_PATHS' => '"${PODS_ROOT}/../.symlinks/plugins/polyvox_filament/macos/lib" "$(inherited)"',
# 'LIBRARY_SEARCH_PATHS' => '"${PODS_ROOT}/../.symlinks/plugins/flutter_filament/macos/lib" "$(inherited)"',
# }
s.pod_target_xcconfig = {

View File

@@ -1,13 +1,13 @@
#pragma once
#ifndef POLYVOX_FILAMENT_LOG_H
#define POLYVOX_FILAMENT_LOG_H
#ifndef FLUTTER_FILAMENT_LOG_H
#define FLUTTER_FILAMENT_LOG_H
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#elif defined __ANDROID__
#include <android/log.h>
#define LOGTAG "PolyvoxFilament"
#define LOGTAG "FlutterFilament"
#else
#include <stdarg.h>
#include <stdio.h>

View File

@@ -1,5 +1,5 @@
#ifndef _POLYVOX_FILAMENT_API_H
#define _POLYVOX_FILAMENT_API_H
#ifndef _FLUTTER_FILAMENT_API_H
#define _FLUTTER_FILAMENT_API_H
#ifdef _WIN32
#ifdef IS_DLL

View File

@@ -1,15 +1,15 @@
#ifndef _POLYVOX_FILAMENT_FFI_API_H
#define _POLYVOX_FILAMENT_FFI_API_H
#ifndef _FLUTTER_FILAMENT_FFI_API_H
#define _FLUTTER_FILAMENT_FFI_API_H
#include "PolyvoxFilamentApi.h"
#include "FlutterFilamentApi.h"
#ifdef __cplusplus
extern "C" {
#endif
///
/// This header replicates most of the methods in PolyvoxFilamentApi.h, and is only intended to be used to generate client FFI bindings.
/// The intention is that calling one of these methods will call its respective method in PolyvoxFilamentApi.h, but wrapped in some kind of thread runner to ensure thread safety.
/// This header replicates most of the methods in FlutterFilamentApi.h, and is only intended to be used to generate client FFI bindings.
/// The intention is that calling one of these methods will call its respective method in FlutterFilamentApi.h, but wrapped in some kind of thread runner to ensure thread safety.
///
typedef int32_t EntityId;
@@ -92,4 +92,4 @@ FLUTTER_PLUGIN_EXPORT void ios_dummy_ffi();
}
#endif
#endif // _POLYVOX_FILAMENT_FFI_API_H
#endif // _FLUTTER_FILAMENT_FFI_API_H

View File

@@ -1,4 +1,4 @@
#import <Flutter/Flutter.h>
@interface PolyvoxFilamentPlugin : NSObject<FlutterPlugin>
@interface FlutterFilamentPlugin : NSObject<FlutterPlugin>
@end

View File

@@ -20,7 +20,7 @@
#include <utils/NameComponentManager.h>
extern "C" {
#include "PolyvoxFilamentApi.h"
#include "FlutterFilamentApi.h"
}
template class std::vector<float>;
namespace polyvox {

View File

@@ -1,8 +1,8 @@
#ifndef SwiftPolyvoxFilamentPlugin_Bridging_Header_h
#define SwiftPolyvoxFilamentPlugin_Bridging_Header_h
#ifndef SwiftFlutterFilamentPlugin_Bridging_Header_h
#define SwiftFlutterFilamentPlugin_Bridging_Header_h
#import "PolyvoxFilamentApi.h"
#import "PolyvoxFilamentFFIApi.h"
#import "FlutterFilamentApi.h"
#import "FlutterFilamentFFIApi.h"
#endif

View File

@@ -15,7 +15,7 @@
#ifndef _THREADPOOL_HPP
#define _THREADPOOL_HPP
namespace polyvox_filament {
namespace flutter_filament {
class ThreadPool {
std::vector<std::thread> pool;

View File

@@ -13,7 +13,7 @@ using namespace polyvox;
extern "C" {
#include "PolyvoxFilamentApi.h"
#include "FlutterFilamentApi.h"
FLUTTER_PLUGIN_EXPORT const void* create_filament_viewer(const void* context, const ResourceLoaderWrapper* const loader, void* const platform, const char* uberArchivePath) {
return (const void*) new FilamentViewer(context, loader, platform, uberArchivePath);

View File

@@ -1,5 +1,5 @@
#include "PolyvoxFilamentFFIApi.h"
#include "FlutterFilamentFFIApi.h"
#include "FilamentViewer.hpp"
#include "Log.hpp"