DEADSOFTWARE

decouple repainting from blitting the FBO; draw touch overlay after FBO
[d2df-sdl.git] / src / game / sdl / g_system.pas
index 7593b02398811605b2981aed31267e8760e8a20c..c53a7b347596c44c4331497c94c7ee3a2cb524b0 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;
@@ -167,8 +173,6 @@ implementation
 
   procedure sys_Repaint;
   begin
-    if glRenderToFBO then
-      e_BlitFramebuffer(gWinSizeX, gWinSizeY);
     SDL_GL_SwapBuffers
   end;