whiterabbit Posted November 7, 2014 Share Posted November 7, 2014 Calling it with no parameters it writes to the %appdata% (on windows) folder with a default filename, and this works fine when ran from the editor. When called from a published project it creates the file ok, but then crashes. To test just add something like this in App:Loop() if self.window:KeyHit(Key.F5) then self.context:Screenshot() end Output from running in editor: Executing "F:\LeadwerksProjects\BugTest_ScreenshotCrash\BugTest_ScreenshotCrash.exe"... Initializing Lua... Executing file "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Scripts/Error.lua" Executing file "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Scripts/App.lua" Initializing OpenGL4 graphics driver... OpenGL version 441 GLSL version 430 Device: AMD Radeon R9 200 Series Loading map "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Maps/temp.map"... Loading material "F:/LeadwerksProjects/BugTest_ScreenshotCrash/materials/developer/bluegrid.mat"... Loading texture "F:/LeadwerksProjects/BugTest_ScreenshotCrash/materials/developer/BlueGrid.tex"... Loading shader "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Shaders/Model/diffuse.shader"... Loading material "F:/LeadwerksProjects/BugTest_ScreenshotCrash/materials/developer/orangegrid.mat"... Loading texture "F:/LeadwerksProjects/BugTest_ScreenshotCrash/materials/developer/orangegrid.tex"... Loading texture "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Materials/Common/bfn.tex"... Loading shader "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Shaders/Misc/occlusionquery.shader"... Loading shader "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Shaders/Model/Shadow/shadow.shader"... Loading shader "F:/LeadwerksProjects/BugTest_ScreenshotCrash/Shaders/Lighting/directionallight.shader"... Writing screenshot "C:\Users\Ben\AppData\Local/BugTest_ScreenshotCrash/Screenshots/screenshot1.tga"... Saved screenshot "C:\Users\Ben\AppData\Local/BugTest_ScreenshotCrash/Screenshots/screenshot1.tga". Setting breakpad minidump AppID = 251810 Steam_SetMinidumpSteamID: Caching Steam ID: 76561198056655896 [API loaded no] Process Complete. Output from running published project (tried both encrypted and unencrypted): Initializing Lua... Warning: Lua sandboxing disabled. Executing file "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Scripts/Error.lua" Executing file "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Scripts/App.lua" Initializing OpenGL4 graphics driver... OpenGL version 441 GLSL version 430 Device: AMD Radeon R9 200 Series Loading map "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Maps/start.map"... Loading material "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/materials/developer/bluegrid.mat"... Loading texture "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/materials/developer/BlueGrid.tex"... Loading shader "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Shaders/Model/diffuse.shader"... Loading material "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/materials/developer/orangegrid.mat"... Loading texture "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/materials/developer/orangegrid.tex"... Loading texture "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Materials/Common/bfn.tex"... Loading shader "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Shaders/Misc/occlusionquery.shader"... Loading shader "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Shaders/Model/Shadow/shadow.shader"... Loading shader "C:/Users/Ben/Desktop/BugTest_ScreenshotCrash_unencrypted/Shaders/Lighting/directionallight.shader"... Writing screenshot "C:\Users\Ben\AppData\Local/BugTest_ScreenshotCrash/Screenshots/screenshot3.tga"... It stops there and pops up with The screenshot file is created ok but the program stops running. In the attached project press F5 and it should trigger it. EDIT: Just changed back to the non-beta branch and it is the same, crashes for me but the screenshot is written ok. BugTest_ScreenshotCrash_published.zip Link to comment Share on other sites More sharing options...
macklebee Posted November 7, 2014 Share Posted November 7, 2014 weird... now i have a crash when ran from the editor in the beta - this just worked earlier this week without issues. edit- i can confirm that the crash does occur whenever done from a published project. Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted November 7, 2014 Share Posted November 7, 2014 Okay, I found the cause. In the meantime you can avoid this by calling Steamworks::Initialize(). 1 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...
Recommended Posts