#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 #include #include "flutter_texture_buffer.h" typedef uint32_t GLuint; namespace flutter_filament { class FlutterAngleTexture : FlutterTextureBuffer { 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, std::function onResizeRequested ); ~FlutterAngleTexture(); void RenderCallback(); GLuint glTextureId = 0; std::unique_ptr texture; private: flutter::PluginRegistrarWindows* _pluginRegistrar; flutter::TextureRegistrar* _textureRegistrar; uint32_t _width = 0; uint32_t _height = 0; bool logged = false; std::function _onResizeRequested; // 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; EGLSurface _eglSurface = EGL_NO_SURFACE; std::unique_ptr _textureDescriptor = nullptr; }; } #endif // _FLUTTER_ANGLE_TEXTURE