rename plugin from PolyvoxFilament to FlutterFilament
rename plugin from PolyvoxFilament to FlutterFilament
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
set(PROJECT_NAME "polyvox_filament")
|
||||
set(PROJECT_NAME "flutter_filament")
|
||||
project(${PROJECT_NAME} LANGUAGES C CXX)
|
||||
|
||||
cmake_policy(VERSION 3.14...3.25)
|
||||
|
||||
# This value is used when generating builds using this plugin, so it must
|
||||
# not be changed
|
||||
set(PLUGIN_NAME "polyvox_filament_plugin")
|
||||
set(PLUGIN_NAME "flutter_filament_plugin")
|
||||
|
||||
# Any new source files that you add to the plugin should be added here.
|
||||
list(APPEND PLUGIN_SOURCES
|
||||
"polyvox_filament_plugin.cpp"
|
||||
"polyvox_filament_plugin.h"
|
||||
"flutter_filament_plugin.cpp"
|
||||
"flutter_filament_plugin.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/AssetManager.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/FilamentViewer.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/PolyvoxFilamentApi.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/PolyvoxFilamentFFIApi.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/FlutterFilamentApi.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/FlutterFilamentFFIApi.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/StreamBufferAdapter.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/TimeIt.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/camutils/Manipulator.cpp"
|
||||
@@ -41,8 +41,8 @@ endif()
|
||||
# Define the plugin library target. Its name must not be changed (see comment
|
||||
# on PLUGIN_NAME above).
|
||||
add_library(${PLUGIN_NAME} SHARED
|
||||
"include/polyvox_filament/polyvox_filament_plugin_c_api.h"
|
||||
"polyvox_filament_plugin_c_api.cpp"
|
||||
"include/flutter_filament/flutter_filament_plugin_c_api.h"
|
||||
"flutter_filament_plugin_c_api.cpp"
|
||||
${PLUGIN_SOURCES}
|
||||
"include/material/image.c"
|
||||
)
|
||||
@@ -269,7 +269,7 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||
|
||||
# List of absolute paths to libraries that should be bundled with the plugin
|
||||
if(USE_ANGLE)
|
||||
set(polyvox_filament_bundled_libraries
|
||||
set(flutter_filament_bundled_libraries
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug/angle/libEGL.dll
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug/angle/libGLESv2.dll
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug/libc++.dll
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#pragma comment(lib, "dwmapi.lib")
|
||||
#pragma comment(lib, "comctl32.lib")
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
static constexpr auto kClassName = L"FLUTTER_FILAMENT_WINDOW";
|
||||
static constexpr auto kWindowName = L"flutter_filament_window";
|
||||
@@ -355,4 +355,4 @@ void BackingWindow::Resize(int width, int height, int left, int top) {
|
||||
}
|
||||
|
||||
HWND BackingWindow::GetHandle() { return _windowHandle; }
|
||||
} // namespace polyvox_filament
|
||||
} // namespace flutter_filament
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <flutter/plugin_registrar_windows.h>
|
||||
#include <flutter/standard_method_codec.h>
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
class BackingWindow {
|
||||
public:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "egl_context.h"
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
EGLContext::EGLContext(flutter::PluginRegistrarWindows* pluginRegistrar, flutter::TextureRegistrar* textureRegistrar); {
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "flutter_angle_texture.h"
|
||||
#include "backend/platforms/PlatformEGL.h"
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
class EGLContext : public FlutterRenderingContext {
|
||||
public:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <thread>
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
static void logEglError(const char *name) noexcept {
|
||||
const char *err;
|
||||
@@ -239,4 +239,4 @@ FlutterAngleTexture::FlutterAngleTexture(
|
||||
result->Success(resultList);
|
||||
}
|
||||
|
||||
} // namespace polyvox_filament
|
||||
} // namespace flutter_filament
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
typedef uint32_t GLuint;
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
class FlutterAngleTexture : FlutterTextureBuffer {
|
||||
public:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma comment(lib, "dxgi.lib")
|
||||
#pragma comment(lib, "d3d11.lib")
|
||||
|
||||
#include "polyvox_filament_plugin.h"
|
||||
#include "flutter_filament_plugin.h"
|
||||
|
||||
// This must be included before many other Windows headers.
|
||||
#include <windows.h>
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
|
||||
#include "PolyvoxFilamentApi.h"
|
||||
#include "FlutterFilamentApi.h"
|
||||
|
||||
#include <Commctrl.h>
|
||||
#include <Windows.h>
|
||||
@@ -46,22 +46,22 @@
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
void PolyvoxFilamentPlugin::RegisterWithRegistrar(
|
||||
void FlutterFilamentPlugin::RegisterWithRegistrar(
|
||||
flutter::PluginRegistrarWindows *registrar) {
|
||||
auto channel =
|
||||
std::make_unique<flutter::MethodChannel<flutter::EncodableValue>>(
|
||||
registrar->messenger(), "app.polyvox.filament/event",
|
||||
&flutter::StandardMethodCodec::GetInstance());
|
||||
|
||||
auto plugin = std::make_unique<PolyvoxFilamentPlugin>(
|
||||
auto plugin = std::make_unique<FlutterFilamentPlugin>(
|
||||
registrar->texture_registrar(), registrar, channel);
|
||||
|
||||
registrar->AddPlugin(std::move(plugin));
|
||||
}
|
||||
|
||||
PolyvoxFilamentPlugin::PolyvoxFilamentPlugin(
|
||||
FlutterFilamentPlugin::FlutterFilamentPlugin(
|
||||
flutter::TextureRegistrar *textureRegistrar,
|
||||
flutter::PluginRegistrarWindows *pluginRegistrar,
|
||||
std::unique_ptr<flutter::MethodChannel<flutter::EncodableValue>> &channel)
|
||||
@@ -76,9 +76,9 @@ PolyvoxFilamentPlugin::PolyvoxFilamentPlugin(
|
||||
}
|
||||
|
||||
|
||||
PolyvoxFilamentPlugin::~PolyvoxFilamentPlugin() {}
|
||||
FlutterFilamentPlugin::~FlutterFilamentPlugin() {}
|
||||
|
||||
ResourceBuffer PolyvoxFilamentPlugin::loadResource(const char *name) {
|
||||
ResourceBuffer FlutterFilamentPlugin::loadResource(const char *name) {
|
||||
|
||||
std::string name_str(name);
|
||||
std::filesystem::path targetFilePath;
|
||||
@@ -128,16 +128,16 @@ ResourceBuffer PolyvoxFilamentPlugin::loadResource(const char *name) {
|
||||
return rb;
|
||||
}
|
||||
|
||||
void PolyvoxFilamentPlugin::freeResource(ResourceBuffer rbuf) {
|
||||
void FlutterFilamentPlugin::freeResource(ResourceBuffer rbuf) {
|
||||
free((void *)rbuf.data);
|
||||
}
|
||||
|
||||
static ResourceBuffer _loadResource(const char *path, void *const plugin) {
|
||||
return ((PolyvoxFilamentPlugin *)plugin)->loadResource(path);
|
||||
return ((FlutterFilamentPlugin *)plugin)->loadResource(path);
|
||||
}
|
||||
|
||||
static void _freeResource(ResourceBuffer rbf, void *const plugin) {
|
||||
((PolyvoxFilamentPlugin *)plugin)->freeResource(rbf);
|
||||
((FlutterFilamentPlugin *)plugin)->freeResource(rbf);
|
||||
}
|
||||
|
||||
// this is the C-style function that will be returned via getRenderCallback
|
||||
@@ -145,12 +145,12 @@ static void _freeResource(ResourceBuffer rbf, void *const plugin) {
|
||||
// this is just a convenient wrapper to call RenderCallback on the actual plugin
|
||||
// instance
|
||||
void render_callback(void *owner) {
|
||||
((PolyvoxFilamentPlugin *)owner)->RenderCallback();
|
||||
((FlutterFilamentPlugin *)owner)->RenderCallback();
|
||||
}
|
||||
|
||||
// this is the method on PolyvoxFilamentPlugin that will copy between D3D
|
||||
// this is the method on FlutterFilamentPlugin that will copy between D3D
|
||||
// textures
|
||||
void PolyvoxFilamentPlugin::RenderCallback() {
|
||||
void FlutterFilamentPlugin::RenderCallback() {
|
||||
if (_context) {
|
||||
auto flutterTextureId = _context->GetFlutterTextureId();
|
||||
#ifdef USE_ANGLE
|
||||
@@ -160,7 +160,7 @@ void PolyvoxFilamentPlugin::RenderCallback() {
|
||||
}
|
||||
}
|
||||
|
||||
void PolyvoxFilamentPlugin::CreateTexture(
|
||||
void FlutterFilamentPlugin::CreateTexture(
|
||||
const flutter::MethodCall<flutter::EncodableValue> &methodCall,
|
||||
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
|
||||
@@ -190,7 +190,7 @@ void PolyvoxFilamentPlugin::CreateTexture(
|
||||
_context->CreateRenderingSurface(width, height, std::move(result), left, top);
|
||||
}
|
||||
|
||||
void PolyvoxFilamentPlugin::DestroyTexture(
|
||||
void FlutterFilamentPlugin::DestroyTexture(
|
||||
const flutter::MethodCall<flutter::EncodableValue> &methodCall,
|
||||
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
|
||||
@@ -211,7 +211,7 @@ void PolyvoxFilamentPlugin::DestroyTexture(
|
||||
|
||||
}
|
||||
|
||||
void PolyvoxFilamentPlugin::HandleMethodCall(
|
||||
void FlutterFilamentPlugin::HandleMethodCall(
|
||||
const flutter::MethodCall<flutter::EncodableValue> &methodCall,
|
||||
std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result) {
|
||||
|
||||
@@ -270,4 +270,4 @@ void PolyvoxFilamentPlugin::HandleMethodCall(
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace polyvox_filament
|
||||
} // namespace flutter_filament
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef FLUTTER_PLUGIN_POLYVOX_FILAMENT_PLUGIN_H_
|
||||
#define FLUTTER_PLUGIN_POLYVOX_FILAMENT_PLUGIN_H_
|
||||
#ifndef FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_
|
||||
#define FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_
|
||||
|
||||
#include <flutter/method_channel.h>
|
||||
#include <flutter/plugin_registrar_windows.h>
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "GL/GL.h"
|
||||
#include "GL/GLu.h"
|
||||
|
||||
#include "PolyvoxFilamentApi.h"
|
||||
#include "FlutterFilamentApi.h"
|
||||
|
||||
#if ANGLE
|
||||
#include "egl_context.h"
|
||||
@@ -22,20 +22,20 @@
|
||||
#include "wgl_context.h"
|
||||
#endif
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
class PolyvoxFilamentPlugin : public flutter::Plugin {
|
||||
class FlutterFilamentPlugin : public flutter::Plugin {
|
||||
public:
|
||||
static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar);
|
||||
|
||||
PolyvoxFilamentPlugin(flutter::TextureRegistrar *textureRegistrar,
|
||||
FlutterFilamentPlugin(flutter::TextureRegistrar *textureRegistrar,
|
||||
flutter::PluginRegistrarWindows *registrar,
|
||||
std::unique_ptr<flutter::MethodChannel<flutter::EncodableValue>>& channel);
|
||||
virtual ~PolyvoxFilamentPlugin();
|
||||
virtual ~FlutterFilamentPlugin();
|
||||
|
||||
// Disallow copy and assign.
|
||||
PolyvoxFilamentPlugin(const PolyvoxFilamentPlugin &) = delete;
|
||||
PolyvoxFilamentPlugin &operator=(const PolyvoxFilamentPlugin &) = delete;
|
||||
FlutterFilamentPlugin(const FlutterFilamentPlugin &) = delete;
|
||||
FlutterFilamentPlugin &operator=(const FlutterFilamentPlugin &) = delete;
|
||||
|
||||
// Called when a method is called on this plugin's channel from Dart.
|
||||
void HandleMethodCall(
|
||||
@@ -66,6 +66,6 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace polyvox_filament
|
||||
} // namespace flutter_filament
|
||||
|
||||
#endif // FLUTTER_PLUGIN_POLYVOX_FILAMENT_PLUGIN_H_
|
||||
#endif // FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "include/polyvox_filament/polyvox_filament_plugin_c_api.h"
|
||||
#include "include/flutter_filament/flutter_filament_plugin_c_api.h"
|
||||
|
||||
#include <flutter/plugin_registrar_windows.h>
|
||||
|
||||
#include "polyvox_filament_plugin.h"
|
||||
#include "flutter_filament_plugin.h"
|
||||
|
||||
void PolyvoxFilamentPluginCApiRegisterWithRegistrar(
|
||||
void FlutterFilamentPluginCApiRegisterWithRegistrar(
|
||||
FlutterDesktopPluginRegistrarRef registrar) {
|
||||
polyvox_filament::PolyvoxFilamentPlugin::RegisterWithRegistrar(
|
||||
flutter_filament::FlutterFilamentPlugin::RegisterWithRegistrar(
|
||||
flutter::PluginRegistrarManager::GetInstance()
|
||||
->GetRegistrar<flutter::PluginRegistrarWindows>(registrar));
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "flutter_texture_buffer.h"
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
class FlutterRenderContext {
|
||||
public:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <flutter/texture_registrar.h>
|
||||
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
class FlutterTextureBuffer {
|
||||
public:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef FLUTTER_PLUGIN_POLYVOX_FILAMENT_PLUGIN_C_API_H_
|
||||
#define FLUTTER_PLUGIN_POLYVOX_FILAMENT_PLUGIN_C_API_H_
|
||||
#ifndef FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_C_API_H_
|
||||
#define FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_C_API_H_
|
||||
|
||||
#include <flutter_plugin_registrar.h>
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT void PolyvoxFilamentPluginCApiRegisterWithRegistrar(
|
||||
FLUTTER_PLUGIN_EXPORT void FlutterFilamentPluginCApiRegisterWithRegistrar(
|
||||
FlutterDesktopPluginRegistrarRef registrar);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // FLUTTER_PLUGIN_POLYVOX_FILAMENT_PLUGIN_C_API_H_
|
||||
#endif // FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_C_API_H_
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <thread>
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
void _release_callback(void *releaseContext) {
|
||||
// ((OpenGLTextureBuffer*)releaseContext)->unlock();
|
||||
@@ -137,4 +137,4 @@ OpenGLTextureBuffer::~OpenGLTextureBuffer() {
|
||||
wglMakeCurrent(NULL, NULL);
|
||||
}
|
||||
|
||||
} // namespace polyvox_filament
|
||||
} // namespace flutter_filament
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
typedef uint32_t GLuint;
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
class OpenGLTextureBuffer : public FlutterTextureBuffer {
|
||||
public:
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#include <string>
|
||||
#include <variant>
|
||||
|
||||
#include "polyvox_filament_plugin.h"
|
||||
#include "flutter_filament_plugin.h"
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
namespace test {
|
||||
|
||||
namespace {
|
||||
@@ -22,8 +22,8 @@ using flutter::MethodResultFunctions;
|
||||
|
||||
} // namespace
|
||||
|
||||
TEST(PolyvoxFilamentPlugin, GetPlatformVersion) {
|
||||
PolyvoxFilamentPlugin plugin;
|
||||
TEST(FlutterFilamentPlugin, GetPlatformVersion) {
|
||||
FlutterFilamentPlugin plugin;
|
||||
// Save the reply value from the success callback.
|
||||
std::string result_string;
|
||||
plugin.HandleMethodCall(
|
||||
@@ -40,4 +40,4 @@ TEST(PolyvoxFilamentPlugin, GetPlatformVersion) {
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace polyvox_filament
|
||||
} // namespace flutter_filament
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "flutter_texture_buffer.h"
|
||||
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
WGLContext::WGLContext(flutter::PluginRegistrarWindows *pluginRegistrar,
|
||||
flutter::TextureRegistrar *textureRegistrar)
|
||||
@@ -148,4 +148,4 @@ void WGLContext::CreateRenderingSurface(
|
||||
|
||||
void *WGLContext::GetSharedContext() { return (void *)_context; }
|
||||
|
||||
} // namespace polyvox_filament
|
||||
} // namespace flutter_filament
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#if WGL_USE_BACKING_WINDOW
|
||||
#include "backing_window.h"
|
||||
#endif
|
||||
namespace polyvox_filament {
|
||||
namespace flutter_filament {
|
||||
|
||||
class WGLContext : public FlutterRenderContext {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user