Justin-Credible / xbox-uwp-sdl2-starter

🎮 A starter project for building an Xbox UWP app using C# and SDL2 in Visual Studio.
https://www.justin-credible.net/2020/12/04/xbox-uwp-sdl2-starter-project/
MIT License
30 stars 7 forks source link

OpenGL? #2

Open momo-AUX1 opened 3 weeks ago

momo-AUX1 commented 3 weeks ago

I planned to integrate OpenGL (Mesa or ANGLE) to it but i keep getting EGL_BAD_NATIVE_WINDOW is there any way we could get the native window handle from it? Or is there a workaround? The issue happens upon setting the opengl flag on window creation

worleydl commented 3 weeks ago

OpenGL appears to be accessible via Mesa you need to swap out SDL2.dll for the SDL-uwp-gl build and include mesa-uwp's dependency DLLs (opengl32/libglapi/libgallium_wgl/z-1)

SDL-UWP does not seem to be compatible with utilizing SDL_Render calls on top of an OpenGL context but you can load GL extensions and interface with it directly.

Sample code here (sorry for it not being on a real fork): https://github.com/worleydl/uwp_gl_sample/tree/partial-cs-demo