Skip to content

Conversation

@literallylara
Copy link

@literallylara literallylara commented Jul 1, 2025

We can save some power by skipping draw_screen() in the main loop when the screensaver is active and additionally delay all other routines by 1s. This saves 5-10 Watts on my home server.

@complexlogic
Copy link
Owner

I totally agree with you that Flex Launcher's drawing code is inefficient. It's not necessary to redraw the screen every single frame, and there are some optimizations that can be made.

However, it's not good to sleep for long periods in the main thread. The launcher needs to be checking for events and responding to them. Sleeping for long periods can lead to an unresponsive application. To merge this, I would need to see the following changes:

  1. Reduce the sleep period to less than 100 ms. Don't worry, this will not have a significant impact on CPU usage. It's really the screen drawing that's driving that.
  2. Check for the window event SDL_WINDOWEVENT_EXPOSED, and always redraw the screen if it is received, even if the screensaver is active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants