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

feat(frame-rate): add configurable frame-rate option #636

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TheYahya
Copy link
Contributor

By this changes, we will be able to set frame rate before starting our program.

p := tea.NewProgram(&m, tea.WithAltScreen())
p.FrameRate(time.Second) // setting frame rate to one second
if err := p.Start(); err != nil {
        fmt.Println("Error running program:", err)
        os.Exit(1)
}

fix #577

@TheYahya TheYahya force-pushed the feat/set-frame-rate branch from 34d50a3 to 4d0a224 Compare January 15, 2023 01:42
@meowgorithm
Copy link
Member

Related #636

@meowgorithm
Copy link
Member

Hi! This doesn't actually solve #636 because it sets a constant framerate as opposed to a max frame rate.

Regardless, if we decide this is something we want to go with with PR will need to:

  1. Introduce a ProgramOption for this, i.e. tea.WithFramerate(30)
  2. Change variable naming should drop camelcasing to match the variable under the hood: FrameRate -> Framerate
  3. Decide if it makes sense for one to be able to change the framerate after the program has started. If so, we'll also want to introduce a command for that so it can be changed from within a program. If not, Program.Framerate should not be exposed.

@aymanbagabas aymanbagabas deleted the branch charmbracelet:main October 28, 2024 17:41
@meowgorithm meowgorithm reopened this Oct 28, 2024
@aymanbagabas aymanbagabas changed the base branch from master to main October 28, 2024 17:58
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.

Feature request: Configure the max frame rate
3 participants