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

Stop Logcat spam #100

Merged
merged 1 commit into from
Jun 8, 2023
Merged

Stop Logcat spam #100

merged 1 commit into from
Jun 8, 2023

Conversation

DavidVentura
Copy link
Contributor

@DavidVentura DavidVentura commented Jun 8, 2023

As far as I can tell, the logcat spam (cnlohr/rawdrawandroid#21) on Android is caused by calling eglSwapBuffers when the surface is invalid.

This change is not required - I think just bubbling up WindowTermination and asking the user to not call CNFGSwapBuffers on a terminated window is sufficient to stop the spam.

The changes in this PR bubble up the event, but also guard against calls to CNFGSwapBuffers when the window is in an invalid state.

@cnlohr
Copy link
Member

cnlohr commented Jun 8, 2023

Should it just instead handle this internally? It is annoying to ask the user to handle yet another function. Do you know if this could somehow be weakly defined?

@cnlohr
Copy link
Member

cnlohr commented Jun 8, 2023

Hmmmmmm

Do you have any idea if there is a way to handle weak events on function calls in single-file headers?

Maybe we can somehow make the default behavior turn swapbuffers into a deellaaayyyy

@cnlohr
Copy link
Member

cnlohr commented Jun 8, 2023

Ooohhh! Ok, I'll just guard it behind a #define. no worries.

@DavidVentura
Copy link
Contributor Author

In this case, with the extra guard it's not necessary to have the user handle the event.

Though, calling a no-op in a loop is not great, so it'd be better if the function is not called, and instead handled gracefully, like it is done for Suspend

@cnlohr
Copy link
Member

cnlohr commented Jun 8, 2023

Hmm. I feel like Suspend/Resume is absolutely required. I've currently guarded it behind a #define so only consumers who want it will need to implement it. I really wonder if there's a way of using weak references in header-only libraries

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.

None yet

2 participants