You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it's also mostly unused!
In principle, it could be used by the wrapping main() to pass arguments to setup(), render(), cleanup(), but in practice many times global variables can do the same job.
@giuliomoro for an idiomatic API, we should actually eliminate global variables altogether. Mutable global variables are unsafe in Rust (and, technically, in general) since they're both mutable and shared. Basically, for this library anyway, even the callback functions are stored in UserData!
What I meant in this issue is that all the bits of UserData that define the callbacks should probably be provided by a macro, rather than by writing out those complicated signatures by hand. The idea here is that the type-safety of Rust guarantees at compile time that you're always using the same struct for UserData.
I'm hoping to teach a workshop to my class at UCSC, and I'll pull the stuff together for the internet...
UserData is basically all boilerplate...
The text was updated successfully, but these errors were encountered: