DEADSOFTWARE

check FBO status and fall back to no-fbo if something is wrong
[d2df-sdl.git] / src / game / sdl / g_system.pas
index 7593b02398811605b2981aed31267e8760e8a20c..68f99188a830691b8f2d149e33ad70873d7a3191 100644 (file)
@@ -103,7 +103,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;