From 939a343cdc93545211b37de24e9d406bf54dcaf0 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 19 Feb 2020 01:15:08 +0300 Subject: [PATCH] default to using FBO; can be disabled via command line --- src/game/g_main.pas | 7 +++---- src/game/g_options.pas | 1 - src/game/sdl/g_system.pas | 4 ++-- src/game/sdl2/g_system.pas | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/game/g_main.pas b/src/game/g_main.pas index 6e393b2..ab6e1d8 100644 --- a/src/game/g_main.pas +++ b/src/game/g_main.pas @@ -438,10 +438,9 @@ begin {$ENDIF} for i := 1 to ParamCount do begin - if (ParamStr(i) = '--con-stdout') then - begin - conbufDumpToStdOut := true; - break + case ParamStr(i) of + '--con-stdout': conbufDumpToStdOut := true; + '--no-fbo': glRenderToFBO := false; end end; diff --git a/src/game/g_options.pas b/src/game/g_options.pas index 706ca33..e89521d 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -815,7 +815,6 @@ initialization conRegVar('r_vsync', @gVSync, '', ''); conRegVar('r_texfilter', @gTextureFilter, '', ''); conRegVar('r_npot', @glNPOTOverride, '', ''); - conRegVar('r_fbo', @glRenderToFBO, '', ''); (* Sound *) conRegVar('s_nosound', @gNoSound, '', ''); diff --git a/src/game/sdl/g_system.pas b/src/game/sdl/g_system.pas index a4cbe64..bba2cae 100644 --- a/src/game/sdl/g_system.pas +++ b/src/game/sdl/g_system.pas @@ -127,9 +127,9 @@ implementation begin {$IFDEF NOGL_INIT} nogl_Init; - if (not nogl_ExtensionSupported('GL_OES_framebuffer_object')) and glRenderToFBO then + if glRenderToFBO and (not nogl_ExtensionSupported('GL_OES_framebuffer_object')) then {$ELSE} - if (not Load_GL_ARB_framebuffer_object()) and glRenderToFBO then + if glRenderToFBO and (not Load_GL_ARB_framebuffer_object()) then {$ENDIF} begin e_LogWriteln('SDL: no framebuffer object support detected'); diff --git a/src/game/sdl2/g_system.pas b/src/game/sdl2/g_system.pas index e4bd070..29a81b0 100644 --- a/src/game/sdl2/g_system.pas +++ b/src/game/sdl2/g_system.pas @@ -158,9 +158,9 @@ implementation begin {$IFDEF NOGL_INIT} nogl_Init; - if (not nogl_ExtensionSupported('GL_OES_framebuffer_object')) and glRenderToFBO then + if glRenderToFBO and (not nogl_ExtensionSupported('GL_OES_framebuffer_object')) then {$ELSE} - if (not Load_GL_ARB_framebuffer_object()) and glRenderToFBO then + if glRenderToFBO and (not Load_GL_ARB_framebuffer_object()) then {$ENDIF} begin e_LogWriteln('SDL: no framebuffer object support detected'); -- 2.29.2