drarem Posted August 24, 2015 Share Posted August 24, 2015 When i create a FPS template, open up the 01 FPS controller sample, then change it to fullscreen and run it. I hit Alt-Tab and it crashes. What is going on, or is there a work around? I'm thinking anywhere from somehow hiding the title bar and container, to maybe hooking the alt-tab in a key event, changing it to non full-screen so it can alt-tab safely. Help please? thanks. Quote Link to comment Share on other sites More sharing options...
reepblue Posted August 24, 2015 Share Posted August 24, 2015 Windows 10 right? Because with Win8.1, I did not have this issue. It also happens when you call window->minimize in C++, but it's more noticeable when you alt-tab from fullscreen mode even if you pause the world like this: // Check to see if the window is active. // Pause the game if it's not. if (window->Active()) { // Update the world. world->Update(); } Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
drarem Posted August 24, 2015 Author Share Posted August 24, 2015 No, it's windows 8.1 nvidia gtx 760 12Gb i7 4790k Is there a call in lua to use the windowed full screen mode or a setting? Quote Link to comment Share on other sites More sharing options...
reepblue Posted August 24, 2015 Share Posted August 24, 2015 In the default script, you can use -fullscreen launch option to enable fullscreen. But yeah, I feel that the issue is when the window is minimized as alt-tabbing in windowed mode does not crash, but alt-tabbing from fullscreen does, which Windows auto minimize the window. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted August 25, 2015 Share Posted August 25, 2015 This is high-priority. I suspect it has to do with rendering while the window is minimized. Will fix tomorrow. 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted August 25, 2015 Share Posted August 25, 2015 Okay, the quick fix is to do check to see if the window is minimized and skip rendering if it is: --Render the world if window:Minimized()==false then world:Render() end You should also add this check in the FPS player script so the game doesn't take control of the mouse when its minimized: --Mouse look self.currentMousePos = window:GetMousePosition() if window:Minimized()==false then window:SetMousePosition(Math:Round(context:GetWidth()/2), Math:Round(context:GetHeight()/2)) end I will add a built-in check in the engine as well. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted August 25, 2015 Share Posted August 25, 2015 You can also just prevent the world from updating when the window is not active or minimized to fix the mouse bug, but I'm glad to see that this sort of thing is getting built in. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted August 25, 2015 Share Posted August 25, 2015 I would also consider pausing the time when the window minimizes, but I am not sure if that's typical. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted August 25, 2015 Share Posted August 25, 2015 Doing so will prevent additional code in scripts such as a check for preventing the mouse locking to the center when minimized Also, I'd make sure it flushes any keys and mouse clicks before the world gets unpaused. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
beo6 Posted August 26, 2015 Share Posted August 26, 2015 i have seen many games that just pause when minimized. Even when only out of focus and in background some of them pause. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.