I am trying to get ANGLE working in C# using P/Invoke. Basically, I am creating a simple 2D surface, and then passing that off to skia (using SkiaSharp). Everything is working a
I'm not answering your question directly.
But a proven-working alternative way is to create a C++ WindowsRuntime Component wrapper project, aka, use C++/CLI(or CXX, should I say?)to do the interop.
You can expose methods like below, expose APIs depending on your needs.
void InitializeEGL(Windows::UI::Core::CoreWindow^ window);
void InitializeEGL(Windows::UI::Xaml::Controls::SwapChainPanel ^ window);
or, if you want to have finer granularity, declare something like below in the C++ WinRT component,
void EglCreateWindowSurface(Platform::IntPtr display, Platform::IntPtr config, Windows::Foundation::Collections::PropertySet^ propertySet);
This little trick will enable you to get around the C# marshaling issue, and I have verfied it to work.
And I'll continue to investigate the C# interop approach.