2019-01-11 23:18:34 +00:00
|
|
|
pub mod consts;
|
|
|
|
pub mod mesh;
|
|
|
|
pub mod model;
|
|
|
|
pub mod pipelines;
|
|
|
|
pub mod renderer;
|
2019-01-12 01:14:58 +00:00
|
|
|
mod util;
|
2019-01-07 21:10:31 +00:00
|
|
|
|
|
|
|
// Reexports
|
|
|
|
pub use self::{
|
2019-01-11 20:14:37 +00:00
|
|
|
consts::Consts,
|
2019-01-13 20:53:55 +00:00
|
|
|
mesh::{Mesh, Tri, Quad},
|
2019-01-07 21:10:31 +00:00
|
|
|
model::Model,
|
2019-01-11 17:30:13 +00:00
|
|
|
renderer::{Renderer, TgtColorFmt, TgtDepthFmt},
|
2019-01-11 20:14:37 +00:00
|
|
|
pipelines::{
|
2019-01-11 23:18:34 +00:00
|
|
|
Globals,
|
2019-01-13 20:53:55 +00:00
|
|
|
figure::{
|
|
|
|
FigurePipeline,
|
|
|
|
Locals as FigureLocals,
|
|
|
|
BoneData as FigureBoneData,
|
2019-01-11 23:18:34 +00:00
|
|
|
},
|
|
|
|
skybox::{
|
|
|
|
create_mesh as create_skybox_mesh,
|
|
|
|
SkyboxPipeline,
|
|
|
|
Locals as SkyboxLocals,
|
|
|
|
},
|
2019-01-14 23:13:58 +00:00
|
|
|
terrain::{
|
|
|
|
TerrainPipeline,
|
|
|
|
Locals as TerrainLocals,
|
|
|
|
},
|
2019-01-11 20:14:37 +00:00
|
|
|
},
|
2019-01-07 21:10:31 +00:00
|
|
|
};
|
|
|
|
|
2019-01-11 17:30:13 +00:00
|
|
|
#[cfg(feature = "gl")]
|
|
|
|
use gfx_device_gl as gfx_backend;
|
2019-01-07 21:10:31 +00:00
|
|
|
|
2019-01-11 20:14:37 +00:00
|
|
|
// Library
|
|
|
|
use gfx;
|
|
|
|
|
2019-01-12 13:56:34 +00:00
|
|
|
/// Used to represent one of many possible errors that may be omitted by the rendering subsystem
|
2019-01-07 21:10:31 +00:00
|
|
|
#[derive(Debug)]
|
2019-01-11 23:18:34 +00:00
|
|
|
pub enum RenderError {
|
|
|
|
PipelineError(gfx::PipelineStateError<String>),
|
|
|
|
UpdateError(gfx::UpdateError<usize>),
|
2019-01-11 20:14:37 +00:00
|
|
|
}
|
2019-01-07 21:10:31 +00:00
|
|
|
|
2019-01-12 13:56:34 +00:00
|
|
|
/// Used to represent a specific rendering configuration.
|
|
|
|
///
|
|
|
|
/// Note that pipelines are tied to the
|
|
|
|
/// rendering backend, and as such it is necessary to modify the rendering subsystem when adding
|
|
|
|
/// new pipelines - custom pipelines are not currently an objective of the rendering subsystem.
|
|
|
|
///
|
|
|
|
/// # Examples
|
|
|
|
///
|
|
|
|
/// - `SkyboxPipeline`
|
2019-01-13 20:53:55 +00:00
|
|
|
/// - `FigurePipeline`
|
2019-01-07 21:10:31 +00:00
|
|
|
pub trait Pipeline {
|
2019-01-11 20:14:37 +00:00
|
|
|
type Vertex:
|
|
|
|
Clone +
|
|
|
|
gfx::traits::Pod +
|
|
|
|
gfx::pso::buffer::Structure<gfx::format::Format>;
|
2019-01-07 21:10:31 +00:00
|
|
|
}
|