Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sapp_input_wait() to fix high cpu usage while idle #640

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 8, 2022

  1. add sapp_input_wait() to fix high cpu usage while idle

    a sokol_app produces constant cpu load because it keeps repainting
    the screen whether something has changed or not. we can fix this
    easily by simply calling XNextEvent(), which blocks if there are no
    pending events. this causes the app to idle until the user interacts
    with the program.
    
    a new function sapp_input_wait() was added to control this behaviour,
    which causes the sokol app to block until the next input is received.
    afterwards, the input_wait flag is cleared and the user has to set
    it again if so desired.
    rofl0r committed Mar 8, 2022
    Configuration menu
    Copy the full SHA
    1450ea5 View commit details
    Browse the repository at this point in the history