mod context_display;
pub use context_display::ContextDisplay;
mod context_builder;
pub use context_builder::ContextBuilder;
pub mod backend;
pub(crate) use backend::gl_context::{GLContext, HasGLContext};
pub trait HasContext: HasGLContext {
fn new(builder: &ContextBuilder) -> Self where Self: Sized;
fn run(&mut self) -> bool;
fn make_current(&self) -> Result<(), ContextError>;
fn swap_buffers(&self) -> Result<(), ContextError>;
fn get_proc_address(&self, addr: &str) -> *const ();
fn inner_dimensions(&self) -> (usize, usize);
}
pub type Context = Box<dyn HasContext>;
#[cfg(not(all(target_arch = "wasm32")))]
mod platform {
mod desktop;
pub use desktop::Context as BackendContext;
pub use desktop::ContextError;
}
#[cfg(all(target_arch = "wasm32"))]
mod platform {
mod web;
pub use web::Context as BackendContext;
pub use web::ContextError;
}
pub use platform::*;