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
Currently user needs to know what kind of data will query to get parameter return, this is error prone. Instead I propose get_parameter that gets it's target argument via generic (ex: gl.get_parameter::<ALPHA_BITS>()), so we can dispatch to proper type at compile time without worrying user what kind of function call should be used (this would also make porting WebGL code to rust easier).
Currently user needs to know what kind of data will query to get parameter return, this is error prone. Instead I propose
get_parameter
that gets it's target argument via generic (ex:gl.get_parameter::<ALPHA_BITS>()
), so we can dispatch to proper type at compile time without worrying user what kind of function call should be used (this would also make porting WebGL code to rust easier).I have a rough prototype of how this implementation would look like in this playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c6922a88ef3d74c8890f70ee79d21f1c
This would be backwards compatible, but
get_parameter
must not be added toHasContext
as it would make it not object safe due to generic arguments.The text was updated successfully, but these errors were encountered: