Skip to content

Conversation

simadude
Copy link
Contributor

There is currently no way to syncronise when to freeze and unfreeze the terminal/monitor once a Lua program is finished drawing, so I've made this function to force it (just ignore that it's frozen) to render the contents of the terminal once. (A better name can be chosen if needed.)

The ROM should also now expect this function or else it will give an error "Redirect object is missing method forceUpdate."

Copy link
Owner

@MCJack123 MCJack123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concept is good, but I'd like to avoid making new functions if possible. Could you move the functionality into setFrozen(false) instead?

Also, I'm concerned about the lack of buffering - it's possible for the application to request an update, but then change the screen before it gets rendered, which could still result in a partial paint. To fix this, there'd need to be some sort of buffer holding the requested render state. Personally I'd like a Lua solution, such as a framebuffer API, but it may be more convenient to put it in C instead - I'll leave this to you to decide on.


// The following fields are available in API version 10.1 and later.
bool frozen = false; // Whether the terminal should stop rendering
bool forcedUpdate = false; // Ignores `frozen` to render the terminal once
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be placed at the end of the class - the current position would break ABI.

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