17cupsofcoffee / tetra

🎮 A simple 2D game framework written in Rust
MIT License
907 stars 63 forks source link

The moethods Shader::from_vertex_string and Shader::from_fragment_string won't build #300

Closed LiquidityC closed 2 years ago

LiquidityC commented 2 years ago

Summary

The following code:

let shader = Shader::from_fragment_string(ctx, include_str!("../shaders/lighting.frag"))?;

produces this error:

let shader = Shader::from_fragment_string(ctx, include_str!("../shaders/lighting.frag"))?;                                                   
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `P` declared on the associated function `from_fragment_string`

Steps to Reproduce

Quite simple to confirm using above code examples.

Additional Info

Removing the parameters from the two mentioned functions fixes the problem. I have a PR ready and I'll send it to you.