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

Feature request: on expose callback #35

Open
MegaLoler opened this issue Mar 20, 2020 · 3 comments
Open

Feature request: on expose callback #35

MegaLoler opened this issue Mar 20, 2020 · 3 comments

Comments

@MegaLoler
Copy link

Hi! I love this little library, fast and easy. <3

I was wondering if you would be interested in adding an "on expose" callback, which gets called when the window needs to be redrawn for any reason?

This would be useful for me because with the way I'm using the library, I'm not redrawing the window continuously for continuous animation. Rather, I'm redrawing only when something changes, or perhaps I'm only drawing a single static frame for the lifetime of the window.

Currently, without an "on expose" callback, this leads to an issue, because without redrawing the frame constantly, the window collects artifacts as other items on the screen cover up the contents of the window. It would also be very useful to know when the window has been created and is ready to be drawn for the first time.

@Darky-Lucera
Copy link
Collaborator

how could we detect such thing?

@MegaLoler
Copy link
Author

As far as I'm aware, the backend should provide something the means. Xlib provides such an event: https://tronche.com/gui/x/xlib/events/exposure/expose.html and imagine others provide similar things.

SDL wraps this event as well: https://www.libsdl.org/release/SDL-1.2.15/docs/html/sdlexposeevent.html

@Darky-Lucera
Copy link
Collaborator

The thing is, we use this event to force repaint the window. Let me do some tests

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

No branches or pull requests

2 participants