I need create_quad to not only return the vertex buffer but also the index buffer. I figured out already that F needs to be of trait Facade, but only because I looked at the signature of glium::VertexBuffer::new.
Now, I don't know what type it should return for the index buffer. let display = glium::glutin::WindowBuilder::new().build_glium().unwrap();
What type is display? let mut target = display.draw();
What type is target?
And most importantly.. how do I go about finding out how to use a library, and in particular what types stuff should be and what methods they have?
There might be a more elegant way for the first question (I'm totally new at this), but I've been assigning bogus types to the variable and letting the compiler complain about the difference. So the code would be:
let display: String = glium::glutin::WindowBuilder::new().build_glium().unwrap();
Build and then enjoy the error messages.
As far as the inflection stuff goes, I'm terribly interested in the answer to this question, too. Maybe using a debugger?
@fcourchesne Do you know if there's any way to get this information without reading the source code? I'm all for reading source code, but it would be nice to have some sort of inspection capabilities too.
@bitgrinder LLDB or GDB will give you that information. The information will not always be trivial to understand. I find reading the source code or docs much clearer to find this type of information. There is also the method of asking the compiler to tell you what it expects by assigning a bogus type to the function as previously mentioned.
The following is how you would get the variable types for my previous answer.
Method using GDB
cargo build (build in debug mode, you will require symbols to debug --release not work well) rust-gdb target/debug/answer (assuming the project is named answer) b main.rs:54 (set breakpoints) b main.rs:59 run (run the program, up to first breakpoint at line 54)