-
Notifications
You must be signed in to change notification settings - Fork 280
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: add synchronized output/update #756
Conversation
The Contour terminal describes a VT extension for pausing rendering in the terminal during updates, preventing tearing and other artifacts. This extension is already supported by several terminals, with support planned for many others. See: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036 This adds the two commands related to pausing and resuming rendering: `BeginSynchronizedUpdate` and `EndSynchronizedUpdate`. It also adds a utility function that performs a function within a synchronized update. A demo of this is also provided in the interactive example, that slowly renders a list of numbers - once without synchronized updates, and then once with.
Co-authored-by: Timon <timonpost@hotmail.nl>
@TimonPost Thanks for the review! I have fixed the failing doctests |
@jcdickinson Sorry for asking here, but there is no discussions area in this repo. I am trying to decide how I will render my game and am not sure the practical difference between using crosterm's Thanks for any input you may have! My render function is very basic, no async, I currently have the following:
|
You should probably use them together. The queue is about efficiency, this command prevents "terminal tearing" (almost like vsync tearing). Issue/queue this at the start of your frame, and terminate it at the end. |
The Contour terminal describes a VT extension for pausing rendering in the terminal during updates, preventing tearing and other artifacts. This extension is already supported by several terminals, with support planned for many others.
See: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
This adds the two commands related to pausing and resuming rendering:
BeginSynchronizedUpdate
andEndSynchronizedUpdate
. It also adds a utility function that performs a function within a synchronized update.A demo of this is also provided in the interactive example, that slowly renders a list of numbers - once without synchronized updates, and then once with.