Menu

#62 100 fps OpenBSD SDL2 build

1.04
closed
nobody
None
2022-12-29
2019-10-01
Nam
No

Building an SDL2 build on OpenBSD, fteqw was getting 100 fps. Sys_Sleep(0) calls SDL_Delay(0), which causes it to sleep anyways. This limits OpenBSD to 100 FPS due to its 100 tick kernel.

I resolved this issue with this patch and now get 600+ fps. It is similar to sys_linux.c.

$OpenBSD$

Index: engine/client/sys_sdl.c
--- engine/client/sys_sdl.c.orig
+++ engine/client/sys_sdl.c
@@ -677,7 +677,8 @@ int QDECL main(int argc, char **argv)
            sleeptime = Host_Frame (time);
            oldtime = newtime;


-           Sys_Sleep(sleeptime);
+           if (sleeptime)
+               Sys_Sleep(sleeptime);
        }
    }

Discussion

  • eukara

    eukara - 2022-03-06
    • status: open --> closed
     
  • eukara

    eukara - 2022-03-06

    Fix similar to this was merged a few years ago, so closing this old issue

     
  • Xylemon

    Xylemon - 2022-12-29
     

Log in to post a comment.

MongoDB Logo MongoDB