[][src]Crate truck_platform

Graphic utility library based on wgpu.

This crate is independent from other truck crates except truck-base. It provides an API that allows users to handle drawing elements in a unified manner. By implementing the Rendered trait, developers can define their own rendering elements and have them rendered in Scene in the same way as other rendering elements provided by truck.

This documentation is intended to be read by two kinds of people: users and developers. Users, those who just want to draw the shape of an existing mesh or boundary representation, will only use:

If you are a developer, who wants to try out new visual representations, you can implement Rendered in your own structure and standardize it in a form that can be used by users in Scene.

The sample code in this crate is for developers. Users may wish to refer to the one in truck-rendimpl.

Re-exports

pub extern crate wgpu;

Macros

derive_bind_group

Derives Rendred::bind_group()

derive_bind_group_layout

Derives Rendred::bind_group_layout()

derive_pipeline

Derives Rendred::pipeline()

derive_render_id

Derives Rendred::render_id()

derive_vertex_buffer

Derives Rendred::vertex_buffer()

impl_render_id

Implements Rendered::render_id().

Structs

BufferHandler

safe handler of GPU buffer Buffer

Camera

Camera

DeviceHandler

Chain that holds Device, Queue and SwapChainDescriptor.

Light

Light

RenderID

The unique ID for Rendered struct.

Scene

Wraps wgpu and provides an intuitive graphics API.

SceneDescriptor

Configures of Scene.

Enums

LightType

the kinds of light sources: point or uniform

ProjectionType

the projection type of camera

Traits

Rendered

Rendered objects in the scene.