Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Dunge
Features
- Simple but flexible API
- Desktop, WASM and Android support
- Customizable vertices and shaders
- Pixel perfect render with custom layers
- Light sources and light spaces
Application area
The library is for personal use only. I use it to create my applications and I make API suitable exclusively for my problems. Perhaps in the future API will settle down and the library will be self-sufficient for other applications.
Getting Started
Let's render a colorful triangle for example. First, we need to add the dependency of dunge in the Cargo.toml:
Then, let's create a new window to draw something in it:
use ;
!
make_window creates a new instance of Canvas type and sets up window properties, it allows us to handle an input from users. run_blocking runs our application by calling the constructor of it and passes the Context object there. Context uses for creation and updating of meshes, textures, instances etc.
To be able to draw something, you need to define a vertex type with the Vertex trait implementation and a shader type with the Shader trait implementation:
use ;
// Instead of manually implementing the trait, use a derive macro.
// Note the struct must have the `repr(C)` attribute
;
;
The App is our application type, we need to create it:
use ;
To be able to pass the App in run_blocking we need to implement a Loop trait for it:
use ;
Finally, let's run our code:
Now you should see something like this

Examples
See examples directory for more examples. To build and run an example do:
Build for Linux
For a more convenient build on other platforms, Linux specific features aren't enabled by default. You need to explicitly specify which window system you want to use:
[]
= { ., features = ["x11"] }
# or
= { ., features = ["wayland"] }
# or both
An universal option to specify the window system for Linux only:
[]
= { ., features = ["x11"] }