Added "SDL_RENDERER_ACCELERATED

This commit is contained in:
George Sokianos 2022-01-05 22:12:18 +00:00
parent 3c7da82ad2
commit 44cd036b7a
2 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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);
}