diff --git a/README.md b/README.md index 4005831..93f784d 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,10 @@ let triangle = |vert: sl::InVertex| { As you can see from the snippet, the shader requires you to provide two things: the position of the vertex on the screen and the color of each fragment/pixel. The result is a `triangle` function, but if you ask for its type in the IDE you may notice that it is more complex than usual: ```rust -impl Fn(InVertex) -> Out>, Ret, Vec2>>, Vec4>, Ret>>, Vec3>, f32>, Vec4>> +impl Fn(InVertex) -> Out< + Ret>, Ret, Vec2>>, Vec4>, + Ret>>, Vec3>, f32>, Vec4>, +> ``` That's because this function doesn't actually compute anything. It is needed only to describe the method for computing what we need on GPU. During shader instantiation, this function is used to compile an actual shader. However, this saves us from having to write the shader in wgsl and allows to typecheck at compile time. For example, dunge checks that a vertex type in a shader matches with a mesh used during rendering. It also checks types inside the shader itself. @@ -141,7 +144,9 @@ Now you can run our application and see the window: window.run(dunge::update(upd, draw))?; ``` - +
+ +
You can see full code from this example [here](https://github.com/nanoqsh/dunge/tree/main/examples/window) and run it using: ```sh