pub mod baker;
pub mod icon;
pub mod models;
mod run;
mod scenario;
mod target;
mod tree;

pub use run::{JigError, RunResult, RunStatus, StepOutcome, StepRecord, run_scenario};
pub use scenario::{
    ArtifactName, ArtifactNameError, Modifier, NodeRef, NodeRefParseError, PointerTarget, Scenario,
    ScenarioError, ScenarioSource, Step, modifier_mask,
};
pub use target::{Candidate, ResolveError, resolve_target};
pub use tree::{DumpNode, DumpStates, TreeDump, TreeDumpError, TreeLoadError};

use bone_render::{AdapterPolicy, OffscreenContext, Result, ViewportExtent, ViewportPx};

pub const DEFAULT_VIEWPORT: ViewportExtent =
    ViewportExtent::new(ViewportPx::new(1280), ViewportPx::new(800));

pub fn offscreen_context(extent: ViewportExtent) -> Result<OffscreenContext> {
    pollster::block_on(OffscreenContext::new(extent, AdapterPolicy::Software))
}
