I’m wondering if someone already tried to use a window handle coming from a C# UserControl in order to use OpenGLES in a C# application. I’m currently building a UserControl in C++/CLI, all my steps are successful (eglGetDisplay, eglInitialize, eglChooseConfig, eglCreateWindowSurface, eglCreateContext) until eglMakeCurrent, where I get a BAD_ALLOC error code.
What could make eglMakeCurrent fail ?
Thanks in advance,
Can you please share the code that makes this happen ? Also the different threads if any.
hdc = e.Graphics.GetHdc();
Thanks for all the answers!
I already used C# handles in order to initialize DirectX rendering, and if I remember well, I used something like (hwnd) Control.Handle.IntPtr. I was not aware of valid or not device context.
I'll check this in a few days, back to work, and upload a csproj.
@carlos, I'm currently testing WindowsEmulation library.