My issue is that, until this change is accepted, I have to override SDL2’s window-procedure to perform the same task in my own code, i.e. after getting the HWND
from SDL_GetWindowWMInfo()
, I call Win32’s GetWindowLongPtr()
with GWLP_WNDPROC
(or GWL_WNDPROC
, as the case may be), and save that in my app’s screen-oriented class (i.e. the same one that stores the pointer to the SDL_Window
). I then call Win32’s SetWindowLongPtr()
with GWLP_WNDPROC
/GWL_WNDPROC
with my override.
In my replacement window-procedure, I have to call the one I fished out of SDL. But all I have at that time is an HWND
, and there seems to be no way to find an SDL_Window
from an HWND
, nor any way to iterate through all existing SDL_Window
instances.
Such a function could easily be added to SDL_video.c
, e.g. SDL_Window *SDL_GetFirstWindow() { return _this->windows; }
and SDL_Window *SDL_GetNextWindow(SDL_Window *window) { return (window == NULL) ? NULL : window->next; }
.
Is there some other API I’m not seeing? Is there a good reason why there’s no existing method to iterate through existing SDL windows?
For now, I’ll obviously have to create my own linked list, to match HWND
to SDL_Window*
.