Open nokola opened 4 years ago
Also note: I'm opening all these issues since I'm going through the nvg-miniquad port and adding tracking issues for whatever the difference is between the nvg expected APIs and miniquad, if the new APIs will improve miniquad.
I agree, Shader::new()
should return Result with error message.
Edit: renamed title to be more generic since I found panic-s in several places:
Shader::new()
get_uniform_location()
apply_bindings()
Pipeline::with_params()
Would be nice to have error propagation in general for miniquad. Perhaps that means EventHandler
updates to have the functions there return Result as well.
Today miniquad will panic if invalid shader code is specified in Shader::new()
It may be useful for callers to gracefully show error message instead of panic!() especially for tools that get arbitrary shader text (e.g. from the user, like https://shadertoy.com)
I propose to add Result<..> to Shader::new() to support error handling