diff --git a/README_OS4.md b/README_OS4.md index 740de43d..de9b9963 100644 --- a/README_OS4.md +++ b/README_OS4.md @@ -40,6 +40,13 @@ https://git.walkero.gr/walkero/lite-xl/issues ## Added - Added config.scroll_past_end that when its true lets the user scroll further than the end of the file. By default is set to false. +- Added "SDL_RENDERER_ACCELERATED" and "SDL_RENDERER_PRESENTVSYNC" on + SDL_CreateRenderer() since this reduces the CPU usage when the user + scrolls and seems to work pretty good on my systems (X5000, A1222 and + microAmigaOne). This is exeprimental. If this brings problems on your + system, you can disable them using SDL ENV variable, like below: + setenv SDL_RENDER_VSYNC 0 + setenv SDL_RENDER_DRIVER "software" ## [1.16.12.6] - 2022-01-04 ### Fixed diff --git a/src/renwindow.c b/src/renwindow.c index b47d0900..58cd7fb9 100644 --- a/src/renwindow.c +++ b/src/renwindow.c @@ -29,7 +29,7 @@ static void setup_renderer(RenWindow *ren, int w, int h) { SDL_DestroyTexture(ren->texture); SDL_DestroyRenderer(ren->renderer); } - ren->renderer = SDL_CreateRenderer(ren->window, -1, 0); + ren->renderer = SDL_CreateRenderer(ren->window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); ren->texture = SDL_CreateTexture(ren->renderer, SDL_PIXELFORMAT_BGRA32, SDL_TEXTUREACCESS_STREAMING, w, h); ren->surface_scale = query_surface_scale(ren); }