initial work to split into dart_filament and flutter_filament
This commit is contained in:
168
flutter_filament/linux/CMakeLists.txt
Normal file
168
flutter_filament/linux/CMakeLists.txt
Normal file
@@ -0,0 +1,168 @@
|
||||
# The Flutter tooling requires that developers have CMake 3.10 or later
|
||||
# installed. You should not increase this version, as doing so will cause
|
||||
# the plugin to fail to compile for some customers of the plugin.
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
# Project-level configuration.
|
||||
set(PROJECT_NAME "flutter_filament")
|
||||
project(${PROJECT_NAME})
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fPIC -Wno-unused-variable -Wno-unused-function")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wno-unused-variable -Wno-unused-function")
|
||||
|
||||
# This value is used when generating builds using this plugin, so it must
|
||||
# not be changed.
|
||||
set(PLUGIN_NAME "flutter_filament_plugin")
|
||||
|
||||
link_directories("${CMAKE_CURRENT_SOURCE_DIR}/lib")
|
||||
|
||||
add_library(FILAMENT_SHADERS SHARED
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/include/material/image.c"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/include/material/unlit_opaque.c"
|
||||
)
|
||||
|
||||
# Define the plugin library target. Its name must not be changed (see comment
|
||||
# on PLUGIN_NAME above).
|
||||
#
|
||||
# Any new source files that you add to the plugin should be added here.
|
||||
add_library(${PLUGIN_NAME} SHARED
|
||||
"flutter_filament_plugin.cc"
|
||||
"filament_texture.cc"
|
||||
"filament_pb_texture.cc"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/SceneManager.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/FilamentViewer.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/FlutterFilamentApi.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/StreamBufferAdapter.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ios/src/TimeIt.cpp"
|
||||
)
|
||||
|
||||
# Apply a standard set of build settings that are configured in the
|
||||
# application-level CMakeLists.txt. This can be removed for plugins that want
|
||||
# full control over build settings.
|
||||
apply_standard_settings(${PLUGIN_NAME})
|
||||
|
||||
# Symbols are hidden by default to reduce the chance of accidental conflicts
|
||||
# between plugins. This should not be removed; any symbols that should be
|
||||
# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro.
|
||||
set_target_properties(${PLUGIN_NAME} PROPERTIES
|
||||
CXX_VISIBILITY_PRESET hidden)
|
||||
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
|
||||
|
||||
target_compile_features(${PLUGIN_NAME} PRIVATE cxx_std_17)
|
||||
|
||||
add_compile_definitions(IS_DLL)
|
||||
|
||||
|
||||
# Source include directories and library dependencies. Add any plugin-specific
|
||||
# dependencies here.
|
||||
target_include_directories(${PLUGIN_NAME} INTERFACE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
|
||||
include_directories(../ios/src)
|
||||
include_directories(../ios/include)
|
||||
include_directories(../example/linux)
|
||||
|
||||
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)
|
||||
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
|
||||
|
||||
add_library(geometry STATIC IMPORTED)
|
||||
set_property(TARGET geometry PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libgeometry.a")
|
||||
add_library(filament STATIC IMPORTED)
|
||||
set_property(TARGET filament PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libfilament.a")
|
||||
add_library(backend STATIC IMPORTED)
|
||||
set_property(TARGET backend PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libbackend.a")
|
||||
add_library(filameshio STATIC IMPORTED)
|
||||
set_property(TARGET filameshio PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libfilameshio.a")
|
||||
add_library(filament_viewer STATIC IMPORTED)
|
||||
set_property(TARGET filament_viewer PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libviewer.a")
|
||||
add_library(filamat STATIC IMPORTED)
|
||||
set_property(TARGET filamat PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libfilamat.a")
|
||||
add_library(utils STATIC IMPORTED)
|
||||
set_property(TARGET utils PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libutils.a")
|
||||
add_library(filabridge STATIC IMPORTED)
|
||||
set_property(TARGET filabridge PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libfilabridge.a")
|
||||
add_library(gltfio_core STATIC IMPORTED)
|
||||
set_property(TARGET gltfio_core PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libgltfio_core.a")
|
||||
add_library(filament-iblprefilter STATIC IMPORTED)
|
||||
set_property(TARGET filament-iblprefilter PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libfilament-iblprefilter.a")
|
||||
add_library(image STATIC IMPORTED)
|
||||
set_property(TARGET image PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimage.a")
|
||||
add_library(camutils STATIC IMPORTED)
|
||||
set_property(TARGET camutils PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libcamutils.a")
|
||||
add_library(filaflat STATIC IMPORTED)
|
||||
set_property(TARGET filaflat PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libfilaflat.a")
|
||||
add_library(dracodec STATIC IMPORTED)
|
||||
set_property(TARGET dracodec PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libdracodec.a")
|
||||
add_library(ibl STATIC IMPORTED)
|
||||
set_property(TARGET ibl PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libibl.a")
|
||||
add_library(ktxreader STATIC IMPORTED)
|
||||
set_property(TARGET ktxreader PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libktxreader.a")
|
||||
add_library(imageio STATIC IMPORTED)
|
||||
set_property(TARGET imageio PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimageio.a")
|
||||
add_library(tinyexr STATIC IMPORTED)
|
||||
set_property(TARGET tinyexr PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libtinyexr.a")
|
||||
add_library(stb STATIC IMPORTED)
|
||||
set_property(TARGET stb PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libstb.a")
|
||||
add_library(bluevk STATIC IMPORTED)
|
||||
set_property(TARGET bluevk PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libbluevk.a")
|
||||
add_library(vkshaders STATIC IMPORTED)
|
||||
set_property(TARGET vkshaders PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libvkshaders.a")
|
||||
add_library(bluegl STATIC IMPORTED)
|
||||
set_property(TARGET bluegl PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libbluegl.a")
|
||||
add_library(uberzlib STATIC IMPORTED)
|
||||
set_property(TARGET uberzlib PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libuberzlib.a")
|
||||
add_library(smol-v STATIC IMPORTED)
|
||||
set_property(TARGET smol-v PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libsmol-v.a")
|
||||
add_library(uberarchive STATIC IMPORTED)
|
||||
set_property(TARGET uberarchive PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libuberarchive.a")
|
||||
add_library(meshoptimizer STATIC IMPORTED)
|
||||
set_property(TARGET meshoptimizer PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libmeshoptimizer.a")
|
||||
add_library(mathio STATIC IMPORTED)
|
||||
set_property(TARGET mathio PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libmathio.a")
|
||||
add_library(math STATIC IMPORTED)
|
||||
set_property(TARGET math PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libmath.a")
|
||||
add_library(basis_transcoder STATIC IMPORTED)
|
||||
set_property(TARGET basis_transcoder PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libbasis_transcoder.a")
|
||||
|
||||
target_link_libraries(${PLUGIN_NAME} PRIVATE
|
||||
FILAMENT_SHADERS
|
||||
gltfio_core
|
||||
filament
|
||||
backend
|
||||
geometry
|
||||
filameshio
|
||||
filament_viewer
|
||||
filamat
|
||||
filabridge
|
||||
filament-iblprefilter
|
||||
camutils
|
||||
filaflat
|
||||
dracodec
|
||||
ibl
|
||||
ktxreader
|
||||
imageio
|
||||
image
|
||||
utils
|
||||
tinyexr
|
||||
stb
|
||||
bluevk
|
||||
vkshaders
|
||||
bluegl
|
||||
uberzlib
|
||||
smol-v
|
||||
uberarchive
|
||||
meshoptimizer
|
||||
mathio
|
||||
math
|
||||
geometry
|
||||
basis_transcoder
|
||||
)
|
||||
|
||||
# List of absolute paths to libraries that should be bundled with the plugin.
|
||||
# This list could contain prebuilt libraries, or libraries created by an
|
||||
# external build triggered from this build file.
|
||||
set(flutter_filament_bundled_libraries
|
||||
""
|
||||
PARENT_SCOPE
|
||||
lib/libgeometry.a
|
||||
)
|
||||
67
flutter_filament/linux/filament_pb_texture.cc
Normal file
67
flutter_filament/linux/filament_pb_texture.cc
Normal file
@@ -0,0 +1,67 @@
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
#include <flutter_linux/fl_texture_registrar.h>
|
||||
#include <flutter_linux/fl_texture.h>
|
||||
#include <flutter_linux/fl_pixel_buffer_texture.h>
|
||||
#include <flutter_linux/fl_texture_gl.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
#include "include/flutter_filament/filament_pb_texture.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
// This was just an experiment for copying pixel buffers to Flutter. This won't actually render anything from Filament.
|
||||
G_DEFINE_TYPE(FilamentPBTexture,
|
||||
filament_pb_texture,
|
||||
fl_pixel_buffer_texture_get_type())
|
||||
|
||||
|
||||
static gboolean video_texture_copy_pixels (FlPixelBufferTexture* texture,
|
||||
const uint8_t** out_buffer,
|
||||
uint32_t* width,
|
||||
uint32_t* height,
|
||||
GError** error) {
|
||||
|
||||
auto buffer = new std::vector<uint8_t>(width*height*4);
|
||||
for (int i = 0; i < width*height*4; i++)
|
||||
{
|
||||
if(i%4 == 1 || i % 4 == 3) {
|
||||
buffer->at(i) = (uint8_t)255;
|
||||
} else {
|
||||
buffer->at(i) = (uint8_t)0;
|
||||
}
|
||||
}
|
||||
*width = width;
|
||||
*height = height;
|
||||
*out_buffer = buffer->data();
|
||||
std::cout << "COPYING PIXEL BUFFER" << std::endl;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void filament_pb_texture_dispose(GObject* object) {
|
||||
G_OBJECT_CLASS(filament_pb_texture_parent_class)->dispose(object);
|
||||
}
|
||||
|
||||
void filament_pb_texture_class_init(FilamentPBTextureClass* klass) {
|
||||
G_OBJECT_CLASS(klass)->dispose = filament_pb_texture_dispose;
|
||||
FL_PIXEL_BUFFER_TEXTURE_CLASS(klass)->copy_pixels = video_texture_copy_pixels;
|
||||
}
|
||||
|
||||
void filament_pb_texture_init(FilamentPBTexture* self) { }
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT FlTexture* create_filament_pb_texture(uint32_t width, uint32_t height, FlTextureRegistrar* registrar) {
|
||||
|
||||
auto pbTexture = FILAMENT_PB_TEXTURE(g_object_new(filament_pb_texture_get_type(), nullptr));
|
||||
|
||||
g_autoptr(FlTexture) texture = FL_TEXTURE(pbTexture);
|
||||
|
||||
if(fl_texture_registrar_register_texture(registrar, texture) == TRUE) {
|
||||
if(fl_texture_registrar_mark_texture_frame_available(registrar,
|
||||
texture) != TRUE) {
|
||||
std::cout << "FAILED" << std::endl;
|
||||
}
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
80
flutter_filament/linux/filament_texture.cc
Normal file
80
flutter_filament/linux/filament_texture.cc
Normal file
@@ -0,0 +1,80 @@
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
#include <flutter_linux/fl_texture_registrar.h>
|
||||
#include <flutter_linux/fl_texture.h>
|
||||
#include <flutter_linux/fl_texture_gl.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
#include "include/flutter_filament/filament_texture.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
|
||||
G_DEFINE_TYPE(FilamentTextureGL,
|
||||
filament_texture_gl,
|
||||
fl_texture_gl_get_type())
|
||||
|
||||
static gboolean
|
||||
filament_texture_populate (FlTextureGL *texture,
|
||||
uint32_t *target,
|
||||
uint32_t *name,
|
||||
uint32_t *width,
|
||||
uint32_t *height,
|
||||
GError **error) {
|
||||
FilamentTextureGL *self = FILAMENT_TEXTURE_GL (texture);
|
||||
*target = GL_TEXTURE_2D;
|
||||
*name = self->texture_id;
|
||||
*width = self->width;
|
||||
*height = self->height;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void filament_texture_gl_dispose(GObject* object) {
|
||||
auto filamentTextureGL = FILAMENT_TEXTURE_GL(object);
|
||||
glDeleteTextures(1, &(filamentTextureGL->texture_id));
|
||||
filamentTextureGL->texture_id = 0;
|
||||
}
|
||||
|
||||
void filament_texture_gl_class_init(FilamentTextureGLClass* klass) {
|
||||
G_OBJECT_CLASS(klass)->dispose = filament_texture_gl_dispose;
|
||||
FL_TEXTURE_GL_CLASS(klass)->populate = filament_texture_populate;
|
||||
}
|
||||
|
||||
void filament_texture_gl_init(FilamentTextureGL* self) { }
|
||||
|
||||
void destroy_filament_texture(FlTexture* texture, FlTextureRegistrar* registrar) {
|
||||
fl_texture_registrar_unregister_texture(registrar, texture);
|
||||
}
|
||||
|
||||
FlTexture* create_filament_texture(uint32_t width, uint32_t height, FlTextureRegistrar* registrar) {
|
||||
auto textureGL = FILAMENT_TEXTURE_GL(g_object_new(filament_texture_gl_get_type(), nullptr));
|
||||
textureGL->width = width;
|
||||
textureGL->height = height;
|
||||
textureGL->registrar = registrar;
|
||||
|
||||
g_autoptr(FlTexture) texture = FL_TEXTURE(textureGL);
|
||||
|
||||
glGenTextures(1, &textureGL->texture_id);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, textureGL->texture_id);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, textureGL->width, textureGL->height, 0, GL_RGBA,
|
||||
GL_UNSIGNED_BYTE, 0);
|
||||
|
||||
if(fl_texture_registrar_register_texture(registrar, texture) == TRUE) {
|
||||
|
||||
if(fl_texture_registrar_mark_texture_frame_available(registrar,
|
||||
texture) != TRUE) {
|
||||
std::cout << "FAILED" << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
889
flutter_filament/linux/flutter_filament_plugin.cc
Normal file
889
flutter_filament/linux/flutter_filament_plugin.cc
Normal file
@@ -0,0 +1,889 @@
|
||||
#include "include/flutter_filament/flutter_filament_plugin.h"
|
||||
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
#include <flutter_linux/fl_texture_registrar.h>
|
||||
#include <flutter_linux/fl_texture_gl.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdk.h>
|
||||
#include <thread>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "include/flutter_filament/filament_texture.h"
|
||||
#include "include/flutter_filament/filament_pb_texture.h"
|
||||
#include "include/flutter_filament/resource_loader.hpp"
|
||||
|
||||
#include "FilamentViewer.hpp"
|
||||
#include "Log.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "FlutterFilamentApi.h"
|
||||
}
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
#include <epoxy/glx.h>
|
||||
|
||||
#define FLUTTER_FILAMENT_PLUGIN(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), flutter_filament_plugin_get_type(), \
|
||||
FlutterFilamentPlugin))
|
||||
|
||||
|
||||
struct _FlutterFilamentPlugin {
|
||||
GObject parent_instance;
|
||||
FlTextureRegistrar* texture_registrar;
|
||||
FlView* fl_view;
|
||||
FlTexture* texture;
|
||||
double width = 0;
|
||||
double height = 0;
|
||||
bool rendering = false;
|
||||
flutter_filament::FilamentViewer* viewer;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(FlutterFilamentPlugin, flutter_filament_plugin, g_object_get_type())
|
||||
|
||||
static gboolean on_frame_tick(GtkWidget* widget, GdkFrameClock* frame_clock, gpointer self) {
|
||||
FlutterFilamentPlugin* plugin = (FlutterFilamentPlugin*)self;
|
||||
|
||||
if(plugin->rendering) {
|
||||
render(plugin->viewer, 0);
|
||||
fl_texture_registrar_mark_texture_frame_available(plugin->texture_registrar,
|
||||
plugin->texture);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static FlMethodResponse* _create_filament_viewer(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
auto callback = new ResourceLoaderWrapper(loadResource, freeResource);
|
||||
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
const double width = fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
const double height = fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
|
||||
self->width = width;
|
||||
self->height = height;
|
||||
|
||||
auto context = glXGetCurrentContext();
|
||||
self->viewer = (flutter_filament::FilamentViewer*)create_filament_viewer(
|
||||
(void*)context,
|
||||
callback
|
||||
);
|
||||
|
||||
GtkWidget *w = gtk_widget_get_toplevel (GTK_WIDGET(self->fl_view));
|
||||
gtk_widget_add_tick_callback(w, on_frame_tick, self,NULL);
|
||||
|
||||
// don't pass a surface to the SwapChain as we are effectively creating a headless SwapChain that will render into a RenderTarget associated with a texture
|
||||
create_swap_chain(self->viewer, nullptr, width, height);
|
||||
create_render_target(self->viewer, ((FilamentTextureGL*)self->texture)->texture_id,width,height);
|
||||
update_viewport_and_camera_projection(self->viewer, width, height, 1.0f);
|
||||
|
||||
g_autoptr(FlValue) result =
|
||||
fl_value_new_int(reinterpret_cast<int64_t>(self->viewer));
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _create_texture(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
if(self->texture) {
|
||||
Log("Error - create_texture called when texture exists.");
|
||||
}
|
||||
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
const double width = fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
const double height = fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
|
||||
self->width = width;
|
||||
self->height = height;
|
||||
|
||||
auto texture = create_filament_texture(uint32_t(width), uint32_t(height), self->texture_registrar);
|
||||
//auto texture = create_filament_pb_texture(uint32_t(width), uint32_t(height), self->texture_registrar);
|
||||
self->texture = texture;
|
||||
|
||||
g_autoptr(FlValue) result =
|
||||
fl_value_new_int(reinterpret_cast<int64_t>(texture));
|
||||
|
||||
Log("Successfully created texture.");
|
||||
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
|
||||
static FlMethodResponse* _update_viewport_and_camera_projection(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
auto width = fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto height = fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
auto scaleFactor = fl_value_get_float(fl_value_get_list_value(args, 2));
|
||||
|
||||
update_viewport_and_camera_projection(self->viewer, width, height, scaleFactor);
|
||||
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(fl_value_new_bool(true)));
|
||||
}
|
||||
|
||||
|
||||
static FlMethodResponse* _get_asset_manager(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
auto assetManager = get_asset_manager(self->viewer);
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(fl_value_new_int(reinterpret_cast<int64_t>(assetManager))));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _resize(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
const double width = fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
const double height = fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
|
||||
destroy_filament_texture(self->texture, self->texture_registrar);
|
||||
|
||||
self->texture = create_filament_texture(uint32_t(width), uint32_t(height), self->texture_registrar);
|
||||
|
||||
create_swap_chain(self->viewer, nullptr, width, height);
|
||||
create_render_target(self->viewer, ((FilamentTextureGL*)self->texture)->texture_id,width,height);
|
||||
|
||||
update_viewport_and_camera_projection(self->viewer, width, height, 1.0f);
|
||||
|
||||
g_autoptr(FlValue) result =
|
||||
fl_value_new_int(reinterpret_cast<int64_t>(self->texture));
|
||||
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _loadSkybox(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
const gchar* path = fl_value_get_string(args);
|
||||
|
||||
load_skybox(self->viewer, path);
|
||||
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _remove_ibl(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
remove_ibl(self->viewer);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _loadIbl(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
auto path = fl_value_get_string(fl_value_get_list_value(args, 0));
|
||||
auto intensity = fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
|
||||
load_ibl(self->viewer, path, intensity);
|
||||
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _removeSkybox(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
std::cout << "Removing skybox" << std::endl;
|
||||
remove_skybox(self->viewer);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_background_image(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
const gchar* path = fl_value_get_string(args);
|
||||
|
||||
set_background_image(self->viewer, path);
|
||||
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_background_color(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
const float r = fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
const float g = fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
const float b = fl_value_get_float(fl_value_get_list_value(args, 2));
|
||||
const float a = fl_value_get_float(fl_value_get_list_value(args, 3));
|
||||
set_background_color(self->viewer, r,g,b,a);
|
||||
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _add_light(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
auto type = (uint8_t)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto color = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
auto intensity = float(fl_value_get_float(fl_value_get_list_value(args, 2)));
|
||||
auto posX = (float)fl_value_get_float(fl_value_get_list_value(args, 3));
|
||||
auto posY = (float)fl_value_get_float(fl_value_get_list_value(args, 4));
|
||||
auto posZ = (float)fl_value_get_float(fl_value_get_list_value(args, 5));
|
||||
auto dirX = (float)fl_value_get_float(fl_value_get_list_value(args, 6));
|
||||
auto dirY = (float)fl_value_get_float(fl_value_get_list_value(args, 7));
|
||||
auto dirZ = (float)fl_value_get_float(fl_value_get_list_value(args, 8));
|
||||
auto shadows = fl_value_get_bool(fl_value_get_list_value(args, 9));
|
||||
|
||||
auto entityId = add_light(self->viewer, type, color, intensity, posX, posY, posZ, dirX, dirY, dirZ, shadows);
|
||||
g_autoptr(FlValue) result = fl_value_new_int(entityId);
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
|
||||
}
|
||||
|
||||
static FlMethodResponse* _load_glb(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto path = fl_value_get_string(fl_value_get_list_value(args, 1));
|
||||
auto unlit = fl_value_get_bool(fl_value_get_list_value(args, 2));
|
||||
auto entityId = load_glb(assetManager, path, unlit);
|
||||
g_autoptr(FlValue) result = fl_value_new_int((int64_t)entityId);
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _get_animation_names(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
g_autoptr(FlValue) result = fl_value_new_list();
|
||||
|
||||
auto numNames = get_animation_count(assetManager, asset);
|
||||
|
||||
for(int i = 0; i < numNames; i++) {
|
||||
gchar out[255];
|
||||
get_animation_name(assetManager, asset, out, i);
|
||||
fl_value_append_take (result, fl_value_new_string (out));
|
||||
}
|
||||
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _remove_asset(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
remove_asset(self->viewer, asset);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _transform_to_unit_cube(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
transform_to_unit_cube(assetManager, asset);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _rotate_start(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
auto x = (float)fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
auto y = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
|
||||
grab_begin(self->viewer, x,y, false);
|
||||
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _rotate_end(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
grab_end(self->viewer);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _rotate_update(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto x = (float)fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
auto y = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
|
||||
grab_update(self->viewer, x,y);
|
||||
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _pan_start(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
|
||||
auto x = (float)fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
auto y = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
|
||||
grab_begin(self->viewer, x,y, true);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _pan_update(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto x = (float)fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
auto y = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
|
||||
grab_update(self->viewer, x,y);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _pan_end(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
grab_end(self->viewer);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_position(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
|
||||
set_position(
|
||||
assetManager,
|
||||
asset,
|
||||
(float)fl_value_get_float(fl_value_get_list_value(args, 2)), // x
|
||||
(float)fl_value_get_float(fl_value_get_list_value(args, 3)), // y
|
||||
(float)fl_value_get_float(fl_value_get_list_value(args, 4)) // z
|
||||
);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_rotation(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
|
||||
set_rotation(
|
||||
assetManager,
|
||||
asset,
|
||||
(float)fl_value_get_float(fl_value_get_list_value(args, 2)), // rads
|
||||
(float)fl_value_get_float(fl_value_get_list_value(args, 3)), // x
|
||||
(float)fl_value_get_float(fl_value_get_list_value(args, 4)), // y
|
||||
(float)fl_value_get_float(fl_value_get_list_value(args, 5 )) // z
|
||||
);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
|
||||
|
||||
static FlMethodResponse* _set_bone_transform(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
throw std::invalid_argument( "received negative value" );
|
||||
// FlValue* args = fl_method_call_get_args(method_call);
|
||||
// auto assetPtr = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
// auto boneName = fl_value_get_string(fl_value_get_list_value(args, 1));
|
||||
// auto meshName = fl_value_get_string(fl_value_get_list_value(args, 2));
|
||||
|
||||
// set_bone_transform(
|
||||
// assetPtr,
|
||||
// boneName,
|
||||
// meshName,
|
||||
// (float)fl_value_get_float(fl_value_get_list_value(args, 3)), // transX
|
||||
// (float)fl_value_get_float(fl_value_get_list_value(args, 4)), // transY
|
||||
// (float)fl_value_get_float(fl_value_get_list_value(args, 5)), // transZ
|
||||
// (float)fl_value_get_float(fl_value_get_list_value(args, 6)), // quatX
|
||||
// (float)fl_value_get_float(fl_value_get_list_value(args, 7)), // quatY
|
||||
// (float)fl_value_get_float(fl_value_get_list_value(args, 8)), // quatZ
|
||||
// (float)fl_value_get_float(fl_value_get_list_value(args, 9)) // quatW
|
||||
// );
|
||||
// g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
// return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_camera(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto cameraName = fl_value_get_string(fl_value_get_list_value(args, 1)) ;
|
||||
|
||||
set_camera(self->viewer, asset, cameraName);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_camera_model_matrix(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
set_camera_model_matrix(self->viewer, fl_value_get_float32_list(args));
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_camera_exposure(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto aperture = (float)fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
auto shutter_speed = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
auto sensitivity = (float)fl_value_get_float(fl_value_get_list_value(args, 2));
|
||||
set_camera_exposure(self->viewer, aperture, shutter_speed, sensitivity);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_camera_position(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto x = (float)fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
auto y = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
auto z = (float)fl_value_get_float(fl_value_get_list_value(args, 2));
|
||||
set_camera_position(self->viewer, x,y, z);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_camera_rotation(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto rads = (float)fl_value_get_float(fl_value_get_list_value(args,0 ));
|
||||
auto x = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
auto y = (float)fl_value_get_float(fl_value_get_list_value(args, 2));
|
||||
auto z = (float)fl_value_get_float(fl_value_get_list_value(args, 3));
|
||||
|
||||
set_camera_rotation(self->viewer, rads, x,y, z);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_rendering(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
self->rendering = (bool)fl_value_get_bool(args);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_frame_interval(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto val = (float) fl_value_get_float(args);
|
||||
set_frame_interval(self->viewer, val);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _grab_begin(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto x = (float)fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
auto y = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
auto pan = (bool)fl_value_get_bool(fl_value_get_list_value(args, 2));
|
||||
grab_begin(self->viewer, x, y, pan);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _grab_end(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
grab_end(self->viewer);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _grab_update(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto x = (float)fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
auto y = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
|
||||
grab_update(self->viewer, x,y);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _scroll_begin(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
scroll_begin(self->viewer);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _scroll_end(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
scroll_end(self->viewer);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _scroll_update(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto x = (float)fl_value_get_float(fl_value_get_list_value(args, 0));
|
||||
auto y = (float)fl_value_get_float(fl_value_get_list_value(args, 1));
|
||||
auto z = (float)fl_value_get_float(fl_value_get_list_value(args, 2));
|
||||
|
||||
scroll_update(self->viewer, x,y, z);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _play_animation(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
auto animationId = (int)fl_value_get_int(fl_value_get_list_value(args, 2));
|
||||
auto loop = (bool)fl_value_get_bool(fl_value_get_list_value(args, 3));
|
||||
auto reverse = (bool)fl_value_get_bool(fl_value_get_list_value(args, 4));
|
||||
auto replaceActive = (bool)fl_value_get_bool(fl_value_get_list_value(args, 5));
|
||||
auto crossfade = (bool)fl_value_get_float(fl_value_get_list_value(args, 6));
|
||||
play_animation(assetManager, asset, animationId, loop, reverse, replaceActive, crossfade);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
|
||||
static FlMethodResponse* _stop_animation(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
auto animationId = (int)fl_value_get_int(fl_value_get_list_value(args, 2));
|
||||
stop_animation(assetManager, asset, animationId);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
|
||||
static FlMethodResponse* _set_morph_target_weights(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
auto entityName = fl_value_get_string(fl_value_get_list_value(args, 2));
|
||||
auto flWeights = fl_value_get_list_value(args, 3);
|
||||
size_t numWeights = fl_value_get_length(flWeights);
|
||||
|
||||
std::vector<float> weights(numWeights);
|
||||
for(int i =0; i < numWeights; i++) {
|
||||
float val = fl_value_get_float(fl_value_get_list_value(flWeights, i));
|
||||
weights[i] = val;
|
||||
}
|
||||
|
||||
set_morph_target_weights(assetManager, asset, entityName, weights.data(), (int)numWeights);
|
||||
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
template class std::vector<int>;
|
||||
|
||||
static FlMethodResponse* _set_morph_animation(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
auto entityName = fl_value_get_string(fl_value_get_list_value(args, 2));
|
||||
|
||||
auto morphDataList = fl_value_get_list_value(args, 3);
|
||||
auto morphDataListLength = fl_value_get_length(morphDataList);
|
||||
auto morphData = std::vector<float>(morphDataListLength);
|
||||
|
||||
for(int i =0; i < morphDataListLength; i++) {
|
||||
morphData[i] = fl_value_get_float(fl_value_get_list_value(morphDataList, i));
|
||||
}
|
||||
|
||||
auto morphIndicesList = fl_value_get_list_value(args, 4);
|
||||
auto morphIndicesListLength = fl_value_get_length(morphIndicesList);
|
||||
auto indices = std::vector<int32_t>(morphIndicesListLength);
|
||||
|
||||
for(int i =0; i < morphIndicesListLength; i++) {
|
||||
FlValue* flMorphIndex = fl_value_get_list_value(morphIndicesList, i);
|
||||
indices[i] = static_cast<int32_t>(fl_value_get_int(flMorphIndex));
|
||||
}
|
||||
|
||||
int64_t numMorphTargets = fl_value_get_int(fl_value_get_list_value(args, 5));
|
||||
int64_t numFrames = fl_value_get_int(fl_value_get_list_value(args, 6));
|
||||
float frameLengthInMs = fl_value_get_float(fl_value_get_list_value(args, 7));
|
||||
|
||||
bool success = set_morph_animation(
|
||||
assetManager,
|
||||
asset,
|
||||
(const char *const)entityName,
|
||||
(const float *const)morphData.data(),
|
||||
(const int* const)indices.data(),
|
||||
static_cast<int>(numMorphTargets),
|
||||
static_cast<int>(numFrames),
|
||||
frameLengthInMs
|
||||
);
|
||||
g_autoptr(FlValue) result = fl_value_new_bool(success);
|
||||
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_animation(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
throw std::invalid_argument( "received negative value" );
|
||||
// FlValue* args = fl_method_call_get_args(method_call);
|
||||
// auto assetPtr = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
|
||||
// const char* entityName = fl_value_get_string(fl_value_get_list_value(args, 1));
|
||||
|
||||
// float* const morphData = (float* const) fl_value_get_float32_list(fl_value_get_list_value(args, 2));
|
||||
|
||||
// int64_t numMorphWeights = fl_value_get_int(fl_value_get_list_value(args, 3));
|
||||
|
||||
// FlValue* flBoneAnimations = fl_value_get_list_value(args, 4);
|
||||
|
||||
// size_t numBoneAnimations = fl_value_get_length(flBoneAnimations);
|
||||
|
||||
// vector<BoneAnimation> boneAnimations;
|
||||
|
||||
// for(int i = 0; i < numBoneAnimations; i++) {
|
||||
|
||||
// FlValue* flBoneAnimation = fl_value_get_list_value(flBoneAnimations, i);
|
||||
|
||||
// FlValue* flBoneNames = fl_value_get_list_value(flBoneAnimation, 0);
|
||||
// FlValue* flMeshNames = fl_value_get_list_value(flBoneAnimation, 1);
|
||||
// float* const frameData = (float* const) fl_value_get_float32_list(fl_value_get_list_value(flBoneAnimation, 2));
|
||||
|
||||
// Log("Framedata %f", frameData);
|
||||
|
||||
// vector<const char*> boneNames;
|
||||
// boneNames.resize(fl_value_get_length(flBoneNames));
|
||||
|
||||
// for(int i=0; i < boneNames.size(); i++) {
|
||||
// boneNames[i] = fl_value_get_string(fl_value_get_list_value(flBoneNames, i)) ;
|
||||
// }
|
||||
|
||||
// vector<const char*> meshNames;
|
||||
// meshNames.resize(fl_value_get_length(flMeshNames));
|
||||
// for(int i=0; i < meshNames.size(); i++) {
|
||||
// meshNames[i] = fl_value_get_string(fl_value_get_list_value(flMeshNames, i));
|
||||
// }
|
||||
|
||||
// const char** boneNamesPtr = (const char**)malloc(boneNames.size() * sizeof(char*));
|
||||
// memcpy((void*)boneNamesPtr, (void*)boneNames.data(), boneNames.size() * sizeof(char*));
|
||||
// auto meshNamesPtr = (const char**)malloc(meshNames.size() * sizeof(char*));
|
||||
// memcpy((void*)meshNamesPtr, (void*)meshNames.data(), meshNames.size() * sizeof(char*));
|
||||
|
||||
// BoneAnimation animation {
|
||||
// .boneNames = boneNamesPtr,
|
||||
// .meshNames = meshNamesPtr,
|
||||
// .data = frameData,
|
||||
// .numBones = boneNames.size(),
|
||||
// .numMeshTargets = meshNames.size()
|
||||
// };
|
||||
|
||||
// boneAnimations.push_back(animation);
|
||||
|
||||
// }
|
||||
|
||||
// int64_t numFrames = fl_value_get_int(fl_value_get_list_value(args, 5));
|
||||
|
||||
// float frameLengthInMs = fl_value_get_float(fl_value_get_list_value(args, 6));
|
||||
|
||||
// auto boneAnimationsPointer = boneAnimations.data();
|
||||
// auto boneAnimationsSize = boneAnimations.size();
|
||||
|
||||
// set_animation(
|
||||
// assetPtr,
|
||||
// entityName,
|
||||
// morphData,
|
||||
// numMorphWeights,
|
||||
// boneAnimationsPointer,
|
||||
// boneAnimationsSize,
|
||||
// numFrames,
|
||||
// frameLengthInMs);
|
||||
|
||||
// g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
// return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _get_morph_target_names(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
auto assetManager = (void*)fl_value_get_int(fl_value_get_list_value(args, 0));
|
||||
auto asset = (EntityId)fl_value_get_int(fl_value_get_list_value(args, 1));
|
||||
auto meshName = fl_value_get_string(fl_value_get_list_value(args, 2));
|
||||
|
||||
g_autoptr(FlValue) result = fl_value_new_list();
|
||||
|
||||
auto numNames = get_morph_target_name_count(assetManager, asset, meshName);
|
||||
|
||||
for(int i = 0; i < numNames; i++) {
|
||||
gchar out[255];
|
||||
get_morph_target_name(assetManager, asset, meshName, out, i);
|
||||
fl_value_append_take (result, fl_value_new_string (out));
|
||||
}
|
||||
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_tone_mapping(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
flutter_filament::ToneMapping toneMapping = static_cast<flutter_filament::ToneMapping>(fl_value_get_int(args));
|
||||
set_tone_mapping(self->viewer, toneMapping);
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(fl_value_new_bool(true)));
|
||||
}
|
||||
|
||||
static FlMethodResponse* _set_bloom(FlutterFilamentPlugin* self, FlMethodCall* method_call) {
|
||||
FlValue* args = fl_method_call_get_args(method_call);
|
||||
set_bloom(self->viewer, fl_value_get_float(args));
|
||||
return FL_METHOD_RESPONSE(fl_method_success_response_new(fl_value_new_bool(true)));
|
||||
}
|
||||
|
||||
// Called when a method call is received from Flutter.
|
||||
static void flutter_filament_plugin_handle_method_call(
|
||||
FlutterFilamentPlugin* self,
|
||||
FlMethodCall* method_call) {
|
||||
|
||||
g_autoptr(FlMethodResponse) response = nullptr;
|
||||
|
||||
const gchar* method = fl_method_call_get_name(method_call);
|
||||
|
||||
if(strcmp(method, "createFilamentViewer") == 0) {
|
||||
response = _create_filament_viewer(self, method_call);
|
||||
} else if(strcmp(method, "createTexture") == 0) {
|
||||
response = _create_texture(self, method_call);
|
||||
} else if(strcmp(method, "updateViewportAndCameraProjection")==0){
|
||||
response = _update_viewport_and_camera_projection(self, method_call);
|
||||
} else if(strcmp(method, "getAssetManager") ==0){
|
||||
response = _get_asset_manager(self, method_call);
|
||||
} else if(strcmp(method, "setToneMapping") == 0) {
|
||||
response = _set_tone_mapping(self, method_call);
|
||||
} else if(strcmp(method, "setBloom") == 0) {
|
||||
response = _set_bloom(self, method_call);
|
||||
} else if(strcmp(method, "resize") == 0) {
|
||||
response = _resize(self, method_call);
|
||||
} else if(strcmp(method, "getContext") == 0) {
|
||||
g_autoptr(FlValue) result =
|
||||
fl_value_new_int(reinterpret_cast<int64_t>(glXGetCurrentContext()));
|
||||
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
} else if(strcmp(method, "getGlTextureId") == 0) {
|
||||
g_autoptr(FlValue) result =
|
||||
fl_value_new_int(reinterpret_cast<unsigned int>(((FilamentTextureGL*)self->texture)->texture_id));
|
||||
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
} else if(strcmp(method, "getResourceLoader") == 0) {
|
||||
ResourceLoaderWrapper* resourceLoader = new ResourceLoaderWrapper(loadResource, freeResource);
|
||||
g_autoptr(FlValue) result =
|
||||
fl_value_new_int(reinterpret_cast<int64_t>(resourceLoader));
|
||||
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
} else if(strcmp(method, "setRendering") == 0) {
|
||||
self->rendering = fl_value_get_bool(fl_method_call_get_args(method_call));
|
||||
response = FL_METHOD_RESPONSE(fl_method_success_response_new(fl_value_new_string("OK")));
|
||||
} else if(strcmp(method, "loadSkybox") == 0) {
|
||||
response = _loadSkybox(self, method_call);
|
||||
} else if(strcmp(method, "loadIbl") == 0) {
|
||||
response = _loadIbl(self, method_call);
|
||||
} else if(strcmp(method, "removeIbl") ==0) {
|
||||
response = _remove_ibl(self, method_call);
|
||||
} else if(strcmp(method, "removeSkybox") == 0) {
|
||||
response = _removeSkybox(self, method_call);
|
||||
} else if(strcmp(method, "render") == 0) {
|
||||
render(self->viewer, 0);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
} else if(strcmp(method, "setBackgroundColor") == 0) {
|
||||
response = _set_background_color(self, method_call);
|
||||
} else if(strcmp(method, "setBackgroundImage") == 0) {
|
||||
response = _set_background_image(self, method_call);
|
||||
} else if(strcmp(method, "addLight") == 0) {
|
||||
response = _add_light(self, method_call);
|
||||
} else if(strcmp(method, "loadGlb") == 0) {
|
||||
response = _load_glb(self, method_call);
|
||||
} else if(strcmp(method, "getAnimationNames") == 0) {
|
||||
response = _get_animation_names(self, method_call);
|
||||
} else if(strcmp(method, "clearAssets") == 0) {
|
||||
clear_assets(self->viewer);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
} else if(strcmp(method, "removeAsset") == 0) {
|
||||
response = _remove_asset(self, method_call);
|
||||
} else if(strcmp(method, "transformToUnitCube") == 0) {
|
||||
response = _transform_to_unit_cube(self, method_call);
|
||||
} else if(strcmp(method, "clearLights") == 0) {
|
||||
clear_lights(self->viewer);
|
||||
g_autoptr(FlValue) result = fl_value_new_string("OK");
|
||||
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result));
|
||||
} else if(strcmp(method, "panStart") == 0) {
|
||||
response = _pan_start(self, method_call);
|
||||
} else if(strcmp(method, "panEnd") == 0) {
|
||||
response = _pan_end(self, method_call);
|
||||
} else if(strcmp(method, "panUpdate") == 0) {
|
||||
response = _pan_update(self, method_call);
|
||||
} else if(strcmp(method, "rotateStart") == 0) {
|
||||
response = _rotate_start(self, method_call);
|
||||
} else if(strcmp(method, "rotateEnd") == 0) {
|
||||
response = _rotate_end(self, method_call);
|
||||
} else if(strcmp(method, "rotateUpdate") == 0) {
|
||||
response = _rotate_update(self, method_call);
|
||||
} else if(strcmp(method, "setRotation") == 0) {
|
||||
response = _set_rotation(self, method_call);
|
||||
} else if(strcmp(method, "setCamera") == 0) {
|
||||
response = _set_camera(self, method_call);
|
||||
} else if(strcmp(method, "setCameraModelMatrix") == 0) {
|
||||
response = _set_camera_model_matrix(self, method_call);
|
||||
} else if(strcmp(method, "setCameraExposure") == 0) {
|
||||
response = _set_camera_exposure(self, method_call);
|
||||
} else if(strcmp(method, "setCameraPosition") == 0) {
|
||||
response = _set_camera_position(self, method_call);
|
||||
} else if(strcmp(method, "setCameraRotation") == 0) {
|
||||
response = _set_camera_rotation(self, method_call);
|
||||
} else if(strcmp(method, "setFrameInterval") == 0) {
|
||||
response = _set_frame_interval(self, method_call);
|
||||
} else if(strcmp(method, "scrollBegin") == 0) {
|
||||
response = _scroll_begin(self, method_call);
|
||||
} else if(strcmp(method, "scrollEnd") == 0) {
|
||||
response = _scroll_end(self, method_call);
|
||||
} else if(strcmp(method, "scrollUpdate") == 0) {
|
||||
response = _scroll_update(self, method_call);
|
||||
} else if(strcmp(method, "grabBegin") == 0) {
|
||||
response = _grab_begin(self, method_call);
|
||||
} else if(strcmp(method, "grabEnd") == 0) {
|
||||
response = _grab_end(self, method_call);
|
||||
} else if(strcmp(method, "grabUpdate") == 0) {
|
||||
response = _grab_update(self, method_call);
|
||||
} else if(strcmp(method, "playAnimation") == 0) {
|
||||
response = _play_animation(self, method_call);
|
||||
} else if(strcmp(method, "stopAnimation") == 0) {
|
||||
response = _stop_animation(self, method_call);
|
||||
} else if(strcmp(method, "setMorphTargetWeights") == 0) {
|
||||
response = _set_morph_target_weights(self, method_call);
|
||||
} else if(strcmp(method, "setMorphAnimation") == 0) {
|
||||
response = _set_morph_animation(self, method_call);
|
||||
} else if(strcmp(method, "getMorphTargetNames") == 0) {
|
||||
response = _get_morph_target_names(self, method_call);
|
||||
} else if(strcmp(method, "setPosition") == 0) {
|
||||
response = _set_position(self, method_call);
|
||||
} else if(strcmp(method, "setBoneTransform") == 0) {
|
||||
response = _set_bone_transform(self, method_call);
|
||||
} else {
|
||||
response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new());
|
||||
}
|
||||
|
||||
fl_method_call_respond(method_call, response, nullptr);
|
||||
|
||||
}
|
||||
|
||||
static void flutter_filament_plugin_dispose(GObject* object) {
|
||||
G_OBJECT_CLASS(flutter_filament_plugin_parent_class)->dispose(object);
|
||||
}
|
||||
|
||||
static void flutter_filament_plugin_class_init(FlutterFilamentPluginClass* klass) {
|
||||
G_OBJECT_CLASS(klass)->dispose = flutter_filament_plugin_dispose;
|
||||
}
|
||||
|
||||
static void flutter_filament_plugin_init(FlutterFilamentPlugin* self) {}
|
||||
|
||||
static void method_call_cb(FlMethodChannel* channel, FlMethodCall* method_call,
|
||||
gpointer user_data) {
|
||||
FlutterFilamentPlugin* plugin = FLUTTER_FILAMENT_PLUGIN(user_data);
|
||||
flutter_filament_plugin_handle_method_call(plugin, method_call);
|
||||
}
|
||||
|
||||
void flutter_filament_plugin_register_with_registrar(FlPluginRegistrar* registrar) {
|
||||
FlutterFilamentPlugin* plugin = FLUTTER_FILAMENT_PLUGIN(
|
||||
g_object_new(flutter_filament_plugin_get_type(), nullptr));
|
||||
|
||||
FlView* fl_view = fl_plugin_registrar_get_view(registrar);
|
||||
plugin->fl_view = fl_view;
|
||||
|
||||
plugin->texture_registrar =
|
||||
fl_plugin_registrar_get_texture_registrar(registrar);
|
||||
|
||||
g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new();
|
||||
g_autoptr(FlMethodChannel) channel =
|
||||
fl_method_channel_new(fl_plugin_registrar_get_messenger(registrar),
|
||||
"app.polyvox.filament/event",
|
||||
FL_METHOD_CODEC(codec));
|
||||
fl_method_channel_set_method_call_handler(channel, method_call_cb,
|
||||
g_object_ref(plugin),
|
||||
g_object_unref);
|
||||
|
||||
g_object_unref(plugin);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
10
flutter_filament/linux/flutter_filament_plugin_private.h
Normal file
10
flutter_filament/linux/flutter_filament_plugin_private.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
|
||||
#include "include/flutter_filament/flutter_filament_plugin.h"
|
||||
|
||||
// This file exposes some plugin internals for unit testing. See
|
||||
// https://github.com/flutter/flutter/issues/88724 for current limitations
|
||||
// in the unit-testable API.
|
||||
|
||||
// Handles the getPlatformVersion method call.
|
||||
FlMethodResponse *get_platform_version();
|
||||
@@ -0,0 +1,44 @@
|
||||
#ifndef FILAMENT_PB_TEXTURE_H
|
||||
#define FILAMENT_PB_TEXTURE_H
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib-object.h>
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
#include <flutter_linux/fl_texture_gl.h>
|
||||
#include <flutter_linux/fl_texture.h>
|
||||
#include <flutter_linux/fl_pixel_buffer_texture.h>
|
||||
#include <flutter_linux/fl_texture_registrar.h>
|
||||
|
||||
|
||||
#ifdef FLUTTER_PLUGIN_IMPL
|
||||
#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define FLUTTER_PLUGIN_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define FILAMENT_PB_TEXTURE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), filament_pb_texture_get_type(), \
|
||||
FilamentPBTexture))
|
||||
|
||||
struct _FilamentPBTexture {
|
||||
FlPixelBufferTexture parent_instance;
|
||||
};
|
||||
|
||||
typedef struct _FilamentPBTexture FilamentPBTexture;
|
||||
typedef struct {
|
||||
FlPixelBufferTextureClass parent_instance;
|
||||
gboolean (*copy_pixels)(FlPixelBufferTexture* texture,
|
||||
const uint8_t** buffer,
|
||||
uint32_t* width,
|
||||
uint32_t* height,
|
||||
GError** error);
|
||||
|
||||
} FilamentPBTextureClass;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT FlTexture* create_filament_pb_texture(uint32_t width, uint32_t height, FlTextureRegistrar* registrar);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,49 @@
|
||||
#ifndef FILAMENT_TEXTURE_H
|
||||
#define FILAMENT_TEXTURE_H
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib-object.h>
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
#include <flutter_linux/fl_texture_gl.h>
|
||||
#include <flutter_linux/fl_texture.h>
|
||||
#include <flutter_linux/fl_texture_registrar.h>
|
||||
|
||||
|
||||
#ifdef FLUTTER_PLUGIN_IMPL
|
||||
#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define FLUTTER_PLUGIN_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define FILAMENT_TEXTURE_GL(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), filament_texture_gl_get_type(), \
|
||||
FilamentTextureGL))
|
||||
|
||||
struct _FilamentTextureGL {
|
||||
FlTextureGL parent_instance;
|
||||
GLuint texture_id;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
FlTextureRegistrar* registrar;
|
||||
};
|
||||
|
||||
typedef struct _FilamentTextureGL FilamentTextureGL;
|
||||
typedef struct {
|
||||
FlTextureGLClass parent_instance;
|
||||
gboolean (*populate)(FlTextureGL* texture,
|
||||
uint32_t* target,
|
||||
uint32_t* name,
|
||||
uint32_t* width,
|
||||
uint32_t* height,
|
||||
GError** error);
|
||||
GLuint texture_id;
|
||||
} FilamentTextureGLClass;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT FlTexture* create_filament_texture(uint32_t width, uint32_t height, FlTextureRegistrar* registrar);
|
||||
FLUTTER_PLUGIN_EXPORT void destroy_filament_texture(FlTexture* texture, FlTextureRegistrar* registrar);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_
|
||||
#define FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_
|
||||
|
||||
#include <flutter_linux/flutter_linux.h>
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#ifdef FLUTTER_PLUGIN_IMPL
|
||||
#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define FLUTTER_PLUGIN_EXPORT
|
||||
#endif
|
||||
|
||||
typedef struct _FlutterFilamentPlugin FlutterFilamentPlugin;
|
||||
typedef struct {
|
||||
GObjectClass parent_class;
|
||||
} FlutterFilamentPluginClass;
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT GType flutter_filament_plugin_get_type();
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT void flutter_filament_plugin_register_with_registrar(
|
||||
FlPluginRegistrar* registrar);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif // FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_
|
||||
@@ -0,0 +1,70 @@
|
||||
#ifndef FLUTTER_FILAMENT_LINUX_RESOURCE_LOADER_H
|
||||
#define FLUTTER_FILAMENT_LINUX_RESOURCE_LOADER_H
|
||||
|
||||
#include <math.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "ResourceBuffer.hpp"
|
||||
|
||||
|
||||
static std::map<uint32_t, void*> _file_assets;
|
||||
static uint32_t _i = 0;
|
||||
|
||||
ResourceBuffer loadResource(const char* name) {
|
||||
|
||||
std::cout << "LOADING RESOURCE" << std::endl;
|
||||
|
||||
char cwd[PATH_MAX];
|
||||
if (getcwd(cwd, sizeof(cwd)) != NULL) {
|
||||
std::cout << "Current working dir: " << cwd << std::endl;
|
||||
}
|
||||
|
||||
string name_str(name);
|
||||
auto id = _i++;
|
||||
|
||||
// this functions accepts URIs, so
|
||||
// - file:// points to a file on the filesystem
|
||||
// - asset:// points to an asset, usually resolved relative to the current working directory
|
||||
// - no prefix is presumed to be an asset
|
||||
if (name_str.rfind("file://", 0) == 0) {
|
||||
name_str = name_str.substr(7);
|
||||
} else if(name_str.rfind("asset://", 0) == 0) {
|
||||
name_str = name_str.substr(7);
|
||||
name_str = string(cwd) + string("/") + name_str;
|
||||
} else {
|
||||
name_str = string(cwd) + string("/build/linux/x64/debug/bundle/data/flutter_assets/") + name_str;
|
||||
}
|
||||
|
||||
std::cout << "Loading resource at " << name_str.c_str() << std::endl;
|
||||
|
||||
streampos length;
|
||||
ifstream is(name_str, ios::binary);
|
||||
if(!is) {
|
||||
std::cout << "Failed to find resource at file path " << name_str.c_str() << std::endl;
|
||||
return ResourceBuffer(nullptr, 0, -1);
|
||||
}
|
||||
is.seekg (0, ios::end);
|
||||
length = is.tellg();
|
||||
char * buffer;
|
||||
buffer = new char [length];
|
||||
is.seekg (0, ios::beg);
|
||||
is.read (buffer, length);
|
||||
is.close();
|
||||
_file_assets[id] = buffer;
|
||||
return ResourceBuffer(buffer, length, id);
|
||||
}
|
||||
|
||||
void freeResource(ResourceBuffer rbuf) {
|
||||
auto it = _file_assets.find(rbuf.id);
|
||||
if (it != _file_assets.end()) {
|
||||
free(it->second);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
BIN
flutter_filament/linux/lib/filament-v1.41.0-linux.tgz
Normal file
BIN
flutter_filament/linux/lib/filament-v1.41.0-linux.tgz
Normal file
Binary file not shown.
3
flutter_filament/linux/lib/libbackend.a
Normal file
3
flutter_filament/linux/lib/libbackend.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:326d07e9416af38355057d2ad449d757cbc037cfaaa3e9759bd25c4c4466be6b
|
||||
size 2097612
|
||||
3
flutter_filament/linux/lib/libbasis_encoder.a
Normal file
3
flutter_filament/linux/lib/libbasis_encoder.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9d633d3e1c66902e7ab8acd85d8acfa1d0612aeff1bfbbbe288eec0082b896dc
|
||||
size 1437550
|
||||
3
flutter_filament/linux/lib/libbasis_transcoder.a
Normal file
3
flutter_filament/linux/lib/libbasis_transcoder.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1e4d4cbf8e87082cd8d4d36f8f8baae8ac89b507d24619470d31d5544d30df01
|
||||
size 552520
|
||||
3
flutter_filament/linux/lib/libbluegl.a
Normal file
3
flutter_filament/linux/lib/libbluegl.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:19b9a4b82cdbc0ecacaadeda185dafe8ef5c38ad86f24deb39d6e437c3ba1706
|
||||
size 1135364
|
||||
3
flutter_filament/linux/lib/libbluevk.a
Normal file
3
flutter_filament/linux/lib/libbluevk.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f211ae118c26fa779eb80ce946311ea9597f54a089b270d4333109760816dd92
|
||||
size 175332
|
||||
3
flutter_filament/linux/lib/libcamutils.a
Normal file
3
flutter_filament/linux/lib/libcamutils.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:647973c7591d20305f238802e9516683e69af4db32fe78cdbe99af7623b62ef7
|
||||
size 59964
|
||||
3
flutter_filament/linux/lib/libcivetweb.a
Normal file
3
flutter_filament/linux/lib/libcivetweb.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8a767cd1119a855e22bb46efa786531dcd35beb27917f486d33da27eb5cbe408
|
||||
size 301758
|
||||
3
flutter_filament/linux/lib/libdracodec.a
Normal file
3
flutter_filament/linux/lib/libdracodec.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:55dda86e14d75a839289c58edd04a21166e7e4c9d354bad990545806d0f297e2
|
||||
size 2736460
|
||||
3
flutter_filament/linux/lib/libfilabridge.a
Normal file
3
flutter_filament/linux/lib/libfilabridge.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b62f0c4515df6b474eddc310e66da0e99f748ceb3b29153a5cac832db6dfbbb3
|
||||
size 64862
|
||||
3
flutter_filament/linux/lib/libfilaflat.a
Normal file
3
flutter_filament/linux/lib/libfilaflat.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:06ca6bd13d07735ba2c6a4003d724b91aa979d884be271d78f0dd149a28b7f8d
|
||||
size 53684
|
||||
3
flutter_filament/linux/lib/libfilamat.a
Normal file
3
flutter_filament/linux/lib/libfilamat.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d0fb9205d81b49c661cd8d34a68f6613b44a8b1ed3dec8a8e3749d678373b67c
|
||||
size 31198232
|
||||
3
flutter_filament/linux/lib/libfilamat_lite.a
Normal file
3
flutter_filament/linux/lib/libfilamat_lite.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b6942efce112eb25a0dd557d7943a4e3be3f1080a173ee2670cfa5b0d1aed0f4
|
||||
size 663716
|
||||
3
flutter_filament/linux/lib/libfilament-iblprefilter.a
Normal file
3
flutter_filament/linux/lib/libfilament-iblprefilter.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:baf0f9103beb8f77efea06a2c938f77b27c2af090d52427a6e1eeb19f7787f33
|
||||
size 70040
|
||||
3
flutter_filament/linux/lib/libfilament.a
Normal file
3
flutter_filament/linux/lib/libfilament.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0af2e6d391839ae00e24ff1ca0bb098ef10ae1107f185735df50f1133ca747a5
|
||||
size 2859018
|
||||
3
flutter_filament/linux/lib/libfilameshio.a
Normal file
3
flutter_filament/linux/lib/libfilameshio.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:14e17d4f05c5c05d01c910dda66ed0e0b143d6d7f00b69123d68bbcbcb6daa72
|
||||
size 42216
|
||||
3
flutter_filament/linux/lib/libgeometry.a
Normal file
3
flutter_filament/linux/lib/libgeometry.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2288510e5247d3b4bbb0928399c1b1ac9ca19dc2756f5ab3791a39167964e0d3
|
||||
size 122340
|
||||
3
flutter_filament/linux/lib/libgltfio.a
Normal file
3
flutter_filament/linux/lib/libgltfio.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:058ef55c342dd39ab7a8aecef52f4f867b1479169780072ee14fa9e14fca1ea3
|
||||
size 51056
|
||||
3
flutter_filament/linux/lib/libgltfio_core.a
Normal file
3
flutter_filament/linux/lib/libgltfio_core.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a7c19ebc166180597907382df8893a1cb6b0107445f798f491fb5e02e8880bb1
|
||||
size 1273720
|
||||
3
flutter_filament/linux/lib/libibl-lite.a
Normal file
3
flutter_filament/linux/lib/libibl-lite.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b925eaf3d01cd86cbd93e5ac3b7cf0aa5c250f5f0aee0ff1df867ae9d890d864
|
||||
size 389598
|
||||
3
flutter_filament/linux/lib/libibl.a
Normal file
3
flutter_filament/linux/lib/libibl.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5237908b95431159cae48b1ec459650dee0dd9106c2ec93503d28824c5a4d420
|
||||
size 476644
|
||||
3
flutter_filament/linux/lib/libimage.a
Normal file
3
flutter_filament/linux/lib/libimage.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ef7ee4e72d8acc062ccf4cb82f50758ca5cb7186f9b6fbb1e80e0e4e13c44b21
|
||||
size 112214
|
||||
3
flutter_filament/linux/lib/libimageio.a
Normal file
3
flutter_filament/linux/lib/libimageio.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8f1f111242f014ee41cb1f6aae70294d1d98a7513d35531d805cc900d534c205
|
||||
size 220784
|
||||
3
flutter_filament/linux/lib/libktxreader.a
Normal file
3
flutter_filament/linux/lib/libktxreader.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bf545ab255a85b85f05f72758752a1f5ed475a3a881f7371e18f0e65b5636ec1
|
||||
size 85610
|
||||
3
flutter_filament/linux/lib/libmatdbg.a
Normal file
3
flutter_filament/linux/lib/libmatdbg.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:10ec95bf983a21338b92208fc1604025ca891ceac7356a4886e9b05619a7e5fb
|
||||
size 8348552
|
||||
3
flutter_filament/linux/lib/libmath.a
Normal file
3
flutter_filament/linux/lib/libmath.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:081baec257e5bb1056b5ddb16a88b1f640320f061cc3ceec053b90ae065cb594
|
||||
size 812
|
||||
3
flutter_filament/linux/lib/libmathio.a
Normal file
3
flutter_filament/linux/lib/libmathio.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ab4b4bbd27990a32da29f7a93f4685daa14d89d1489bf2bf86723585dafb7823
|
||||
size 61086
|
||||
3
flutter_filament/linux/lib/libmeshoptimizer.a
Normal file
3
flutter_filament/linux/lib/libmeshoptimizer.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5698733c2f0ec022fbf73a3ef560962fe705445605a8c92d2a753d2ca4a30054
|
||||
size 174864
|
||||
3
flutter_filament/linux/lib/libmikktspace.a
Normal file
3
flutter_filament/linux/lib/libmikktspace.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e81e890eea666a2e19f3c1d56ba91f39d71a55fab00c6b0585a7d958e11de2ed
|
||||
size 26814
|
||||
3
flutter_filament/linux/lib/libshaders.a
Normal file
3
flutter_filament/linux/lib/libshaders.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9d96b998912cba46a10df603a2935a8c6648c4f9ecd81e3ef01d08d3ab5deada
|
||||
size 127214
|
||||
3
flutter_filament/linux/lib/libsmol-v.a
Normal file
3
flutter_filament/linux/lib/libsmol-v.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:385ab5a76cf98b5ab185e36ea341fa78ef62402d57613d8be648a4dd141fd859
|
||||
size 52676
|
||||
3
flutter_filament/linux/lib/libstb.a
Normal file
3
flutter_filament/linux/lib/libstb.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8aba29a52ef1dbbdc3d48f1ad9d9616ab544f7d3045733adc9b9de1172ec383e
|
||||
size 128686
|
||||
3
flutter_filament/linux/lib/libtinyexr.a
Normal file
3
flutter_filament/linux/lib/libtinyexr.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bc8e80b0e43fcf1918b6e85368b2d72b20e392bc3badfca0481556e90568f305
|
||||
size 203598
|
||||
3
flutter_filament/linux/lib/libuberarchive.a
Normal file
3
flutter_filament/linux/lib/libuberarchive.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b99bfdfd707379e878d4412014345b29029f90d9ad44072832fc9f4f4e3a2c60
|
||||
size 1318116
|
||||
3
flutter_filament/linux/lib/libuberzlib.a
Normal file
3
flutter_filament/linux/lib/libuberzlib.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ac377730ab0d180e7e7c0a0a20f0f87a224d5f133b2a5e0a786f9196609a9623
|
||||
size 33806
|
||||
3
flutter_filament/linux/lib/libutils.a
Normal file
3
flutter_filament/linux/lib/libutils.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:796695f0dc99759a6c17a0c3a8382ff1f57b62155224ad051ae9f3fee325f455
|
||||
size 323506
|
||||
3
flutter_filament/linux/lib/libviewer.a
Normal file
3
flutter_filament/linux/lib/libviewer.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6238d9c7ce9d5943c1df2875ebf32bb07b5004c707afa4d6d083d31d320a2ca5
|
||||
size 572924
|
||||
3
flutter_filament/linux/lib/libvkshaders.a
Normal file
3
flutter_filament/linux/lib/libvkshaders.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9d63c579457652ff0fa3b588004d48e8fdb351f15e51b024a359c86f1cb218c5
|
||||
size 2358
|
||||
3
flutter_filament/linux/lib/libzstd.a
Normal file
3
flutter_filament/linux/lib/libzstd.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c169b961355c52a1213efa6703339007a124cab6be92bf56b8031889b1aa7866
|
||||
size 823082
|
||||
3
flutter_filament/linux/lib/old/libOGLCompiler.a
Normal file
3
flutter_filament/linux/lib/old/libOGLCompiler.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4aaf436489ba71b8c6f5d921cad39f1c4e3104c176c374efae3a728e45d11502
|
||||
size 3940
|
||||
3
flutter_filament/linux/lib/old/libOSDependent.a
Normal file
3
flutter_filament/linux/lib/old/libOSDependent.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0327c66ed61c78233914909dcffc410fbb056faa6900d3db17d67459d3f31fa6
|
||||
size 5294
|
||||
3
flutter_filament/linux/lib/old/libSPIRV-Tools-diff.a
Normal file
3
flutter_filament/linux/lib/old/libSPIRV-Tools-diff.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ac1387628b4d7ebd89a3121815540256f46e5aaf397c3023d0974bcc3a85506f
|
||||
size 499778
|
||||
3
flutter_filament/linux/lib/old/libSPIRV-Tools-link.a
Normal file
3
flutter_filament/linux/lib/old/libSPIRV-Tools-link.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a75e67e06921513fb04dc8d5aaeb6b975eab1bab0bcd02d3a0a39398c162c6ac
|
||||
size 162318
|
||||
3
flutter_filament/linux/lib/old/libSPIRV-Tools-lint.a
Normal file
3
flutter_filament/linux/lib/old/libSPIRV-Tools-lint.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6b6bab1c7a792a4769f479ad55d0c116f8755c418ebe7d64292ccf7a6fbcb033
|
||||
size 273884
|
||||
3
flutter_filament/linux/lib/old/libSPIRV-Tools-opt.a
Normal file
3
flutter_filament/linux/lib/old/libSPIRV-Tools-opt.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:464c750b313575d2c2c62cf1ace18eb67813a654c12e9ab809b5e9b5a02b9160
|
||||
size 12709646
|
||||
3
flutter_filament/linux/lib/old/libSPIRV-Tools-reduce.a
Normal file
3
flutter_filament/linux/lib/old/libSPIRV-Tools-reduce.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:88f1ab1b62fec378637a8608d26e39a4f9cccfad68898fe132f1e7d56c57caa7
|
||||
size 836218
|
||||
3
flutter_filament/linux/lib/old/libSPIRV-Tools.a
Normal file
3
flutter_filament/linux/lib/old/libSPIRV-Tools.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:70c565068260155b85b1b20e3fc65469475f522fa38581482f4f15e984a8a26f
|
||||
size 4047794
|
||||
3
flutter_filament/linux/lib/old/libSPIRV.a
Normal file
3
flutter_filament/linux/lib/old/libSPIRV.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2933df356c0346f58d55c0682a6a9828561a3d0a3c16119220efe20d1467e4cc
|
||||
size 1773318
|
||||
3
flutter_filament/linux/lib/old/libassimp.a
Normal file
3
flutter_filament/linux/lib/old/libassimp.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:aa3d111b7912c2e1e23fe382dcecd19a33091800da9e27635980de264cd89efe
|
||||
size 3880496
|
||||
3
flutter_filament/linux/lib/old/libbackend.a
Normal file
3
flutter_filament/linux/lib/old/libbackend.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b9233bbaf23bf4b02ca13f93b2bbb7a6c40ee0d933dfc0dfe3830ecd6ec68b38
|
||||
size 2107852
|
||||
3
flutter_filament/linux/lib/old/libbasis_encoder.a
Normal file
3
flutter_filament/linux/lib/old/libbasis_encoder.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:17bd4166018341677a88d292dd7304a3fcf8a2e7fff90efda230baac0fdf2f1d
|
||||
size 1410760
|
||||
3
flutter_filament/linux/lib/old/libbasis_transcoder.a
Normal file
3
flutter_filament/linux/lib/old/libbasis_transcoder.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:281309f415bd4ecc69dcb29e77629fe40abd6f7c9ca242026ce797a907984fc1
|
||||
size 551702
|
||||
3
flutter_filament/linux/lib/old/libbenchmark.a
Normal file
3
flutter_filament/linux/lib/old/libbenchmark.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2741667ac0e1e0e0272a80e1fc73de59bbbc39740e19fd79bd06c98a6269757e
|
||||
size 591234
|
||||
3
flutter_filament/linux/lib/old/libbenchmark_main.a
Normal file
3
flutter_filament/linux/lib/old/libbenchmark_main.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:22b4861b8b446fe1b1f5aa785ab09bb81d8eeae50bf5e428ac3043c08201fcf2
|
||||
size 2192
|
||||
3
flutter_filament/linux/lib/old/libbluegl.a
Normal file
3
flutter_filament/linux/lib/old/libbluegl.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e2ba9458f588d16f7ba1fffaddb71cac3b918266bbe88d30710547d03fe7f533
|
||||
size 1135298
|
||||
3
flutter_filament/linux/lib/old/libbluevk.a
Normal file
3
flutter_filament/linux/lib/old/libbluevk.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:88fb5b1d62898e8f6e5d485f4e7e60b6d71c2e2246aa81aea70e300a7a91068e
|
||||
size 175364
|
||||
3
flutter_filament/linux/lib/old/libcamutils.a
Normal file
3
flutter_filament/linux/lib/old/libcamutils.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fcb1603eb181df3098f80f150b8a0d23d32f772f152fee063599ba85c3818b9b
|
||||
size 62092
|
||||
3
flutter_filament/linux/lib/old/libcivetweb.a
Normal file
3
flutter_filament/linux/lib/old/libcivetweb.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d57782d4dca672e74332d51c534b78d03b3646725e86710f3556184ba71e3f9c
|
||||
size 300742
|
||||
3
flutter_filament/linux/lib/old/libdracodec.a
Normal file
3
flutter_filament/linux/lib/old/libdracodec.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e5bc48d7c66f24823f093b1dfc7d45073526b2a1f7f8660e337cadbc82081182
|
||||
size 2745300
|
||||
3
flutter_filament/linux/lib/old/libfilabridge.a
Normal file
3
flutter_filament/linux/lib/old/libfilabridge.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bda7d726a5c7fc7dc6bacb6460dbc338d86d63d7cfb311b3aa2678cf118fad8d
|
||||
size 71580
|
||||
3
flutter_filament/linux/lib/old/libfilaflat.a
Normal file
3
flutter_filament/linux/lib/old/libfilaflat.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d06d5f9fe917fbe6095c1cee333fced10a07f295e689e8bc91eefee3ab7aa934
|
||||
size 50170
|
||||
3
flutter_filament/linux/lib/old/libfilagui.a
Normal file
3
flutter_filament/linux/lib/old/libfilagui.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:34eb1d23ed8172a1f889262c9a19e4f79c95cc400d81af242ae88920f3c6fc74
|
||||
size 114036
|
||||
3
flutter_filament/linux/lib/old/libfilamat.a
Normal file
3
flutter_filament/linux/lib/old/libfilamat.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2bf46fcbae5a2472d09a321119ef0e094018a6185dda50cd94671f4827a9fe49
|
||||
size 31487058
|
||||
3
flutter_filament/linux/lib/old/libfilamat_combined.a
Normal file
3
flutter_filament/linux/lib/old/libfilamat_combined.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdde9c8708cadcde670a376407c455b4b16c53892cbefa0d6436307c249e6eaf
|
||||
size 29448180
|
||||
3
flutter_filament/linux/lib/old/libfilamat_lite.a
Normal file
3
flutter_filament/linux/lib/old/libfilamat_lite.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a648a8f87cd29bc9bf44c9ee2a80d79d9ecd1e008d421409f5f512e449af9860
|
||||
size 685184
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ac11be97f3bcc3c00f52185d8489e64781c99691579b31be14790a73111cadf2
|
||||
size 70144
|
||||
3
flutter_filament/linux/lib/old/libfilament.a
Normal file
3
flutter_filament/linux/lib/old/libfilament.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:86f8afa67a774faab4d30bc295b67801d8d70df6dbd2cd893459484592cc43cb
|
||||
size 2849794
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:32daace64e95eab47eeedcf41316a206ea7524242da5b978e11e5c126ccb1950
|
||||
size 1017810
|
||||
3
flutter_filament/linux/lib/old/libfilamentapp.a
Normal file
3
flutter_filament/linux/lib/old/libfilamentapp.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:38f04e48455161b25bb8c713713bee391ce7908f4f1881d1464585e7ad59b2d2
|
||||
size 356048
|
||||
3
flutter_filament/linux/lib/old/libfilameshio.a
Normal file
3
flutter_filament/linux/lib/old/libfilameshio.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f1748f7b321170f0d2c62c344f79dd18aa544bcc15e24012a08171508e87070a
|
||||
size 41324
|
||||
3
flutter_filament/linux/lib/old/libgeometry.a
Normal file
3
flutter_filament/linux/lib/old/libgeometry.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:382b1617880bf2553a51debd2ce2a8171d8e3a7739287ea583dfda5747150783
|
||||
size 123772
|
||||
3
flutter_filament/linux/lib/old/libgetopt.a
Normal file
3
flutter_filament/linux/lib/old/libgetopt.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d30c6cbedc32007ec3100a1f5b683e5dd6183ef321ac953de09b9862b1e6d40d
|
||||
size 8016
|
||||
3
flutter_filament/linux/lib/old/libglslang.a
Normal file
3
flutter_filament/linux/lib/old/libglslang.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:de4997c7619ed8f581dc93fde892cbdb7a8a193c96f3f464a9164ce539cc876e
|
||||
size 4621260
|
||||
3
flutter_filament/linux/lib/old/libgltf-demo-resources.a
Normal file
3
flutter_filament/linux/lib/old/libgltf-demo-resources.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:696c21bc5f7c0b33f0779b508a47cffde4bbb0fd3e3e2be356fe8b0eb6567120
|
||||
size 3955646
|
||||
3
flutter_filament/linux/lib/old/libgltfio.a
Normal file
3
flutter_filament/linux/lib/old/libgltfio.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2a3bc7fa31ee5a598e4398c76da43d4631cefb717d3b4edeb6382c0a0c9adffe
|
||||
size 47924
|
||||
3
flutter_filament/linux/lib/old/libgltfio_core.a
Normal file
3
flutter_filament/linux/lib/old/libgltfio_core.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4e9c3fa5af012fec4c7b416319295ed1d596c41e050bc6fbc0569cec624a532a
|
||||
size 1250160
|
||||
3
flutter_filament/linux/lib/old/libgtest.a
Normal file
3
flutter_filament/linux/lib/old/libgtest.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4708f5c09ce031cc389ff2b2da2015c118f2e615846c4989a89900ce8b6b8547
|
||||
size 891830
|
||||
3
flutter_filament/linux/lib/old/libibl-lite.a
Normal file
3
flutter_filament/linux/lib/old/libibl-lite.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a05e4b140cf4d8e6444401308c636a877c01399533798e73d1430a3b6765a512
|
||||
size 399170
|
||||
3
flutter_filament/linux/lib/old/libibl.a
Normal file
3
flutter_filament/linux/lib/old/libibl.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d45dd173257b3b3df778bb923a324f2e57cb61b4b5fa226839d646cae530a10d
|
||||
size 486290
|
||||
3
flutter_filament/linux/lib/old/libimage.a
Normal file
3
flutter_filament/linux/lib/old/libimage.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8a4aded9717cd630ceda3bf468cdc9b383c2e6cb0f6f5b8191642bef55677eac
|
||||
size 113934
|
||||
3
flutter_filament/linux/lib/old/libimgui.a
Normal file
3
flutter_filament/linux/lib/old/libimgui.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0a21917307e13645d9dbcb80e516ce7fc0ec74a08f05fd6260741109ae213c59
|
||||
size 1984050
|
||||
3
flutter_filament/linux/lib/old/libktxreader.a
Normal file
3
flutter_filament/linux/lib/old/libktxreader.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a5a99686de9781302ad3989167352dbe3050c63f611d9d9825dea50a25722253
|
||||
size 85792
|
||||
3
flutter_filament/linux/lib/old/libmatdbg.a
Normal file
3
flutter_filament/linux/lib/old/libmatdbg.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:abcbab3fe10636113804ee35f706132b1c689312df6e64b3cc12241fd8807e3f
|
||||
size 8427566
|
||||
3
flutter_filament/linux/lib/old/libmatdbg_combined.a
Normal file
3
flutter_filament/linux/lib/old/libmatdbg_combined.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7dfc57add9555eb8ff3973ff294f10c6dd45e4119be046bccceb45e4f91faef7
|
||||
size 7384824
|
||||
3
flutter_filament/linux/lib/old/libmatdbg_resources.a
Normal file
3
flutter_filament/linux/lib/old/libmatdbg_resources.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3c7227ca0aea3a171e1dba93bc434d9ea8e175d4f31cc52165ebdecb00282f8f
|
||||
size 23744
|
||||
3
flutter_filament/linux/lib/old/libmatlang.a
Normal file
3
flutter_filament/linux/lib/old/libmatlang.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c2372bd1a5d8c119a61042f66e0cc153fe02b901bb4194379886e6960eccc158
|
||||
size 735324
|
||||
3
flutter_filament/linux/lib/old/libmeshoptimizer.a
Normal file
3
flutter_filament/linux/lib/old/libmeshoptimizer.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2181fb9a0a814117e6f427741fca5b94a74ff7d1c561e42a2ac3fda45cb978e7
|
||||
size 177664
|
||||
3
flutter_filament/linux/lib/old/libmikktspace.a
Normal file
3
flutter_filament/linux/lib/old/libmikktspace.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a52df85ad23304c30afbc5c07831c2ac030ecb5eccdaa8eef0cfb5a04fd80109
|
||||
size 26798
|
||||
3
flutter_filament/linux/lib/old/libpng.a
Normal file
3
flutter_filament/linux/lib/old/libpng.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8ecd3731472c14aa487a51052f3becbbf12077e10c8373c66ef72559134cd70b
|
||||
size 380418
|
||||
3
flutter_filament/linux/lib/old/libsample-resources.a
Normal file
3
flutter_filament/linux/lib/old/libsample-resources.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:617c1a04b3ec1e41374faf6d8f37796c7ce1fd9fba72199f4ce873fccb4c3013
|
||||
size 8140782
|
||||
3
flutter_filament/linux/lib/old/libsdl2.a
Normal file
3
flutter_filament/linux/lib/old/libsdl2.a
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9991225fc5156f48ae4bb31f5b5cbba90978dd45b92fec3115cfc7d90fa61cac
|
||||
size 2029366
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user