Changeset View
Changeset View
Standalone View
Standalone View
source/ps/GameSetup/GameSetup.cpp
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | void GUI_DisplayLoadProgress(int percent, const wchar_t* pending_task) | ||||
JS::RootedValue valPendingTask(cx); | JS::RootedValue valPendingTask(cx); | ||||
scriptInterface.ToJSVal(cx, &valPendingTask, pending_task); | scriptInterface.ToJSVal(cx, &valPendingTask, pending_task); | ||||
paramData.append(valPendingTask); | paramData.append(valPendingTask); | ||||
g_GUI->GetActiveGUI()->SendEventToAll("GameLoadProgress", paramData); | g_GUI->GetActiveGUI()->SendEventToAll("GameLoadProgress", paramData); | ||||
} | } | ||||
void SwapBuffers() | bool ShouldRender() | ||||
{ | { | ||||
PROFILE3("swap buffers"); | return !g_app_minimized && (g_app_has_focus || !g_VideoMode.IsInFullscreen()); | ||||
Silier: !g_VideoMode.IsInFullscreen() | |||||
Done Inline Actionsah, you're right, I misunderstood this condition. wraitii: ah, you're right, I misunderstood this condition. | |||||
SDL_GL_SwapWindow(g_VideoMode.GetWindow()); | |||||
ogl_WarnIfError(); | |||||
} | } | ||||
void Render() | void Render() | ||||
{ | { | ||||
// Do not render if not focused while in fullscreen or minimised, | // Do not render if not focused while in fullscreen or minimised, | ||||
// as that triggers a difficult-to-reproduce crash on some graphic cards. | // as that triggers a difficult-to-reproduce crash on some graphic cards. | ||||
if (g_app_minimized || (!g_app_has_focus && g_VideoMode.IsInFullscreen())) | if (!ShouldRender()) | ||||
return; | return; | ||||
PROFILE3("render"); | PROFILE3("render"); | ||||
ogl_WarnIfError(); | ogl_WarnIfError(); | ||||
g_Profiler2.RecordGPUFrameStart(); | g_Profiler2.RecordGPUFrameStart(); | ||||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | #endif | ||||
PROFILE2_ATTR("blend splats: %d", (int)g_Renderer.GetStats().m_BlendSplats); | PROFILE2_ATTR("blend splats: %d", (int)g_Renderer.GetStats().m_BlendSplats); | ||||
PROFILE2_ATTR("particles: %d", (int)g_Renderer.GetStats().m_Particles); | PROFILE2_ATTR("particles: %d", (int)g_Renderer.GetStats().m_Particles); | ||||
ogl_WarnIfError(); | ogl_WarnIfError(); | ||||
g_Profiler2.RecordGPUFrameEnd(); | g_Profiler2.RecordGPUFrameEnd(); | ||||
ogl_WarnIfError(); | ogl_WarnIfError(); | ||||
SwapBuffers(); | |||||
} | } | ||||
ErrorReactionInternal psDisplayError(const wchar_t* UNUSED(text), size_t UNUSED(flags)) | ErrorReactionInternal psDisplayError(const wchar_t* UNUSED(text), size_t UNUSED(flags)) | ||||
{ | { | ||||
// If we're fullscreen, then sometimes (at least on some particular drivers on Linux) | // If we're fullscreen, then sometimes (at least on some particular drivers on Linux) | ||||
// displaying the error dialog hangs the desktop since the dialog box is behind the | // displaying the error dialog hangs the desktop since the dialog box is behind the | ||||
// fullscreen window. So we just force the game to windowed mode before displaying the dialog. | // fullscreen window. So we just force the game to windowed mode before displaying the dialog. | ||||
// (But only if we're in the main thread, and not if we're being reentrant.) | // (But only if we're in the main thread, and not if we're being reentrant.) | ||||
▲ Show 20 Lines • Show All 1,328 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
!g_VideoMode.IsInFullscreen()