#pragma once #ifndef _FLUTTER_ANGLE_TEXTURE_H #define _FLUTTER_ANGLE_TEXTURE_H #include #include #include #include #include #include #include "EGL/egl.h" #include "EGL/eglext.h" #include "EGL/eglplatform.h" #include "GLES2/gl2.h" #include "GLES2/gl2ext.h" #include #include "PlatformANGLE.h" #include #include typedef uint32_t GLuint; namespace polyvox_filament { class FlutterAngleTexture { public: FlutterAngleTexture( flutter::PluginRegistrarWindows* pluginRegistrar, flutter::TextureRegistrar* textureRegistrar, std::unique_ptr> result, uint32_t width, uint32_t height, ID3D11Device* D3D11Device, ID3D11DeviceContext* D3D11DeviceContext, EGLConfig eglConfig, EGLDisplay eglDisplay, EGLContext eglContext ); ~FlutterAngleTexture(); void RenderCallback(); int64_t flutterTextureId = 0; GLuint glTextureId = 0; std::unique_ptr texture; filament::backend::Platform* platform = nullptr; private: flutter::PluginRegistrarWindows* _pluginRegistrar; flutter::TextureRegistrar* _textureRegistrar; uint32_t _width = 0; uint32_t _height = 0; bool logged = false; std::shared_ptr _renderMutex; // Device ID3D11Device* _D3D11Device = nullptr; ID3D11DeviceContext* _D3D11DeviceContext = nullptr; // Texture objects/shared handles Microsoft::WRL::ComPtr _externalD3DTexture2D; Microsoft::WRL::ComPtr _internalD3DTexture2D; HANDLE _externalD3DTextureHandle = nullptr; HANDLE _internalD3DTextureHandle = nullptr; EGLDisplay _eglDisplay = EGL_NO_DISPLAY; EGLContext _eglContext = EGL_NO_CONTEXT; EGLConfig _eglConfig = EGL_NO_CONFIG_KHR; std::unique_ptr _textureDescriptor = nullptr; }; } #endif // _FLUTTER_ANGLE_TEXTURE