summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-07-19 15:47:53 -0400
committerpommicket <pommicket@gmail.com>2023-07-19 19:03:44 -0400
commit37f6dd7f1027e82fd12c12fca6ff0bae00e4004c (patch)
treef6ff0e5745b97adb4b418075a6bd33c8a7deec35 /main.c
parent0d84543e4a88b74aed0dec6a9ceab80b8e44c131 (diff)
cache buffer_lsp (improves performance a fair bit)
Diffstat (limited to 'main.c')
-rw-r--r--main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/main.c b/main.c
index 0f9b0e7..d37aedb 100644
--- a/main.c
+++ b/main.c
@@ -1117,13 +1117,6 @@ int main(int argc, char **argv) {
buffer_check_valid(&ted->line_buffer);
#endif
- double frame_end_noswap = time_get_seconds();
- #if PROFILE_FRAME
- {
- print("Frame (noswap): %.1f ms\n", (frame_end_noswap - frame_start) * 1000);
- }
- #endif
-
if (ted->dragging_tab_node)
ted->cursor = ted->cursor_move;
@@ -1135,6 +1128,8 @@ int main(int argc, char **argv) {
SDL_ShowCursor(SDL_DISABLE);
}
+ double frame_end_noswap = time_get_seconds();
+ #if !PROFILE_FRAME
{
// annoyingly, SDL_GL_SwapWindow seems to be a busy loop on my laptop for some reason...
// this is why the framerate-cap settings exists
@@ -1155,8 +1150,13 @@ int main(int argc, char **argv) {
prev_vsync = settings->vsync;
SDL_GL_SetSwapInterval(settings->vsync ? 1 : 0);
}
- SDL_GL_SwapWindow(window);
}
+ #else
+ (void)frame_end_noswap;
+ SDL_GL_SetSwapInterval(0);
+ #endif
+ SDL_GL_SwapWindow(window);
+
PROFILE_TIME(frame_end)
assert(glGetError() == 0);