Sam Lantinga 6a342954e8 Fixed bug 5451 - Can't create EGLSurface in Wayland from SDLWindow (no EGLNativeWindow pointer)
sashikknox

In some cases, need create EGLWindow with SDLWindow. In X11 i can get pointer to NativeWindow from **struct SDL_SysWMinfo wmInfo**
```C++
struct SDL_SysWMinfo wmInfo;
SDL_GetWindowWMInfo(ptSDLWindow, &wmInfo)
#if defined(__unix__) && defined(SDL_VIDEO_DRIVER_X11)
nativeWindow=(EGLNativeWindowType)wmInfo.info.x11.window;
nativeDisplay=(EGLNativeDisplayType)wmInfo.info.x11.display;
#endif
```
than i can create EGLSurface
```
eglCreateWindowSurface(nativeDisplay, EGL_CONFIG, nativeWindow, SURFACE_ATTRIBUTES);
```
in Wayland i can do it with same way, just need pointer to **EGLWindow**, we already have pointer to **wl_display** from **SDL_sysWMInfo**, need add to **wl** struct in SDL_SysWMInfo another pointer to **struct wl_egl_window *egl_window;**. And in wayland backend, in function **Wayland_GetWindowWMInfo** return pointer to **egl_window** from **SDL_WindowData**
Now i use patched statically built SDL2 in port of Quake 2 GLES2 for SailfishOS (it use QtWayland):
link to SDL2 commit and changed string for patch:
- 6858a618cd
- b1e29e87b9/SDL2/src/video/wayland/SDL_waylandwindow.c (L463)

link to use in Quake2 port:
1. here i get pointer to EGLNativeWindowType:  6d94fedb1b/Engine/Sources/Compatibility/OpenGLES/EGLWrapper.c (L319)
2. then use it for create EGLSurface: 6d94fedb1b/Engine/Sources/Compatibility/OpenGLES/EGLWrapper.c (L391)
2021-01-14 14:42:53 -08:00
..
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2021-01-02 10:25:38 -08:00
2020-06-02 16:59:54 -07:00
2021-01-02 10:25:38 -08:00