DEADSOFTWARE

check FBO status and fall back to no-fbo if something is wrong
[d2df-sdl.git] / src / game / sdl2 / g_system.pas
index 31c5b1cde5c4147282cd52211f24446cd9a47e12..992d6dc4c7091de9906f6f9808ef695c7553542c 100644 (file)
@@ -107,7 +107,13 @@ implementation
       // store real window size in gWinSize, downscale resolution now
       w := round(w / r_pixel_scale);
       h := round(h / r_pixel_scale);
-      e_ResizeFramebuffer(w, h);
+      if not e_ResizeFramebuffer(w, h) then
+      begin
+        e_LogWriteln('GL: could not create framebuffer, falling back to --no-fbo');
+        glRenderToFBO := False;
+        w := gWinSizeX;
+        h := gWinSizeY;
+      end;
     end;
     gScreenWidth := w;
     gScreenHeight := h;