mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-03-21 02:12:27 +01:00
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: - |
||
---|---|---|
.. | ||
SDL_waylandclipboard.c | ||
SDL_waylandclipboard.h | ||
SDL_waylanddatamanager.c | ||
SDL_waylanddatamanager.h | ||
SDL_waylanddyn.c | ||
SDL_waylanddyn.h | ||
SDL_waylandevents_c.h | ||
SDL_waylandevents.c | ||
SDL_waylandmouse.c | ||
SDL_waylandmouse.h | ||
SDL_waylandopengles.c | ||
SDL_waylandopengles.h | ||
SDL_waylandsym.h | ||
SDL_waylandtouch.c | ||
SDL_waylandtouch.h | ||
SDL_waylandvideo.c | ||
SDL_waylandvideo.h | ||
SDL_waylandvulkan.c | ||
SDL_waylandvulkan.h | ||
SDL_waylandwindow.c | ||
SDL_waylandwindow.h |