Module evegfx::commands[][src]

Interface to the EVE graphics coprocessor.

You can get a Coprocessor object by calling EVE::coprocessor or EVE::coprocessor_polling on an EVE object for the appropriate EVE model.

Coprocessor is the main interface to the graphics coprocessor. Applications typically switch to primarily using the graphics coprocessor once they've completed initialization, because it allows streaming commands to the EVE chip with the possibility for synchronization with the display raster, and provides higher-level helpers for building display lists.

// "ei" is an implementation of evegfx::interface::Interface.
let eve = evegfx::EVE::new(evegfx::BT815, ei);
// (...do initial boot sequence for the "eve" object...)
let mut cp = eve.coprocessor_polling()?;
cp.new_display_list(|cp| {
    use evegfx::display_list::Builder; // so trait methods are available
    use evegfx::display_list::options;
    cp.clear_all()?;
    cp.begin(options::GraphicsPrimitive::LineStrip);
    cp.draw(options::GraphicsPrimitive::LineStrip, |mut shape| {
        shape.vertex_2f((10, 10))?;
        shape.vertex_2f((100, 10))?;
        shape.vertex_2f((100, 100))?;
        shape.vertex_2f((10, 100))?;
        shape.vertex_2f((10, 10))
    })?;
    cp.display()
})?;

Modules

options

Various types used as arguments to coprocessor commands.

strfmt

Interface to the coprocessor's string formatting features.

waiter

Helpers for waiting until the coprocessor has freed enough ring buffer space for a forthcoming command.

Structs

Coprocessor

An interface to the command ring buffer for the EVE chip's coprocessor component.

Enums

Error

Error type for coprocessor operations.

Type Definitions

Result

The result type for coprocessor operations, where the error type is always Error.