You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to implement the ability to change the window size using the mouse in my project, ensuring that its proportions match the proportions of the game frame.
In SDL2, it was enough to watch system events and if it was about the WM_SIZING message, you could modify the window area given in lParam in the message structure. Everything worked fine, I tested it and even posted the solution on the forum.
SDL3, however, no longer supports system events, and instead we can register a message hook, using the SDL_SetWindowsMessageHook function. This way we can watch and manipulate system messages before they are processed by SDL. So I can catch the WM_SIZING message in this callback, modify the window size/position, and then SDL will use that message to generate an SDL_EVENT_WINDOW_RESIZED event.
The problem, however, is that when resizing the window with the mouse, the hook callback is not called at all. I checked under the debugger and the hook callback is called for all window messages, but not when resizing the window with the mouse:
I don't know why when resizing a window with the mouse, the hook callback is not called, but it should be so that the application can watch all system messages and react to them.
Just in case, if it matters, I have three callbacks registered in my project:
Hit-test callback — using the SDL_SetWindowHitTest function, to be able to handle borderless window with custom decoration.
Message hook — using the SDL_SetWindowsMessageHook function, to be able to control the window size/position when resizing the window using the mouse.
Event watcher — using the SDL_AddEventWatch function, to be able to re-render the game window during resizing the window with the mouse.
The text was updated successfully, but these errors were encountered:
I need to implement the ability to change the window size using the mouse in my project, ensuring that its proportions match the proportions of the game frame.
In SDL2, it was enough to watch system events and if it was about the
WM_SIZING
message, you could modify the window area given inlParam
in the message structure. Everything worked fine, I tested it and even posted the solution on the forum.SDL3, however, no longer supports system events, and instead we can register a message hook, using the SDL_SetWindowsMessageHook function. This way we can watch and manipulate system messages before they are processed by SDL. So I can catch the
WM_SIZING
message in this callback, modify the window size/position, and then SDL will use that message to generate anSDL_EVENT_WINDOW_RESIZED
event.The problem, however, is that when resizing the window with the mouse, the hook callback is not called at all. I checked under the debugger and the hook callback is called for all window messages, but not when resizing the window with the mouse:
I don't know why when resizing a window with the mouse, the hook callback is not called, but it should be so that the application can watch all system messages and react to them.
Just in case, if it matters, I have three callbacks registered in my project:
The text was updated successfully, but these errors were encountered: