-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SDL+Vulkan example when minimized #3259
Conversation
Fixes crash when minimized / recover from minimized of SDL_Vulkan example by adding additional events, SDL_WINDOWEVENT_MINIMIZED and SDL_WINDOWEVENT_RESTORED
g_SwapChainResizeHeight = (int)event.window.data2; | ||
g_SwapChainRebuild = true; | ||
case SDL_WINDOWEVENT: | ||
if (event.window.event == SDL_WINDOWEVENT_MINIMIZED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix indentation to be consistent with other code.
Hello,
Will look for another solution to this issue and try to patch the GLFW+Vulkan example which has the same issue. (PS: As pointed out above it's generally good when making a pull-request to try to conform to the local coding style. Thanks!) |
Hi Omar,
*<<*
- *I get a bunch of validation layer error when trying to resize to
zero.*
- *I'm not sure why you commented out the windowID compare, this is most
likely required to work with multi-viewports.*
*>>*
I don't resize to zero I define a minimum size for resizing.
My original problem was crashing on minimize or recover from minimized.
Solving that problem was including the callbacks for MINIMIZED and RESTORED
to rebuild the swapchain. Without I get the following error
*VkResult -1000001004*
I don't use multiple viewports but had that changed already in the
night here (not on git)
* case SDL_WINDOWEVENT:*
* if (event.window.event == SDL_WINDOWEVENT_MAXIMIZED)*
* {*
* printf("Maximized\n");*
* }*
* if (event.window.event == SDL_WINDOWEVENT_MINIMIZED &&
event.window.windowID == SDL_GetWindowID(window))*
* {*
* g_SwapChainResizeWidth = (int)event.window.data1;*
* g_SwapChainResizeHeight = (int)event.window.data2;*
* g_SwapChainRebuild = true;*
* }*
* if (event.window.event == SDL_WINDOWEVENT_RESTORED &&
event.window.windowID == SDL_GetWindowID(window))*
* {*
* g_SwapChainResizeWidth = (int)event.window.data1;*
* g_SwapChainResizeHeight = (int)event.window.data2;*
* g_SwapChainRebuild = true;*
* }*
* if (event.window.event == SDL_WINDOWEVENT_RESIZED &&
event.window.windowID == SDL_GetWindowID(window))*
* {*
* g_SwapChainResizeWidth = (int)event.window.data1;*
* g_SwapChainResizeHeight = (int)event.window.data2;*
* g_SwapChainRebuild = true;*
* }*
* break;*
Best Regards
Thomas Richter
…On Mon, 25 May 2020 at 11:01, omar ***@***.***> wrote:
Hello,
Thanks for reporting this.
- I get a bunch of validation layer error when trying to resize to
zero.
- I'm not sure why you commented out the windowID compare, this is
most likely required to work with multi-viewports.
Will look for another solution to this issue and try to patch the
GLFW+Vulkan example which has the same issue.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3259 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD6WYM34SXTXWP56ANQXP73RTI6YNANCNFSM4NJD3K7Q>
.
|
# Conflicts: # examples/example_glfw_vulkan/main.cpp # examples/example_sdl_vulkan/main.cpp # examples/imgui_impl_sdl.cpp # imgui.cpp
Thomas,
Pushed a couple of commits to address this in master and with multi-viewports, for both GLFW and SDL. Thanks for the report! |
Fixes crash when minimized / recover from minimized of SDL_Vulkan example by adding additional events,
SDL_WINDOWEVENT_MINIMIZED and SDL_WINDOWEVENT_RESTORED
Thomas