#ifndef FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_ #define FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_ #include #include #include #include #include #include #include #include "GL/GL.h" #include "GL/GLu.h" #include "FlutterFilamentApi.h" #if USE_ANGLE #include "egl_context.h" #else #include "wgl_context.h" #endif namespace flutter_filament { class FlutterFilamentPlugin : public flutter::Plugin { public: static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar); FlutterFilamentPlugin(flutter::TextureRegistrar *textureRegistrar, flutter::PluginRegistrarWindows *registrar, std::unique_ptr>& channel); virtual ~FlutterFilamentPlugin(); // Disallow copy and assign. FlutterFilamentPlugin(const FlutterFilamentPlugin &) = delete; FlutterFilamentPlugin &operator=(const FlutterFilamentPlugin &) = delete; // Called when a method is called on this plugin's channel from Dart. void HandleMethodCall( const flutter::MethodCall &method_call, std::unique_ptr> result); flutter::PluginRegistrarWindows *_pluginRegistrar; flutter::TextureRegistrar *_textureRegistrar; std::unique_ptr> _channel; std::map _resources; void CreateTexture( const flutter::MethodCall &methodCall, std::unique_ptr> result); void DestroyTexture( const flutter::MethodCall &methodCall, std::unique_ptr> result); void RenderCallback(); ResourceBuffer loadResource(const char *path); void freeResource(ResourceBuffer rbuf); private: #ifdef USE_ANGLE std::unique_ptr _context = nullptr; #else std::unique_ptr _context = nullptr; #endif }; } // namespace flutter_filament #endif // FLUTTER_PLUGIN_FLUTTER_FILAMENT_PLUGIN_H_