Warning
This library is currently undergoing major revisions. Use at your own risk!
Table of Contents
A set of tools designed to work as a replacement for (or addition to) Rust's standard library.
The primary goal of Bog is to have a set of interoperable tools that you can use from the early stages of any project all the way to its final release. Things useful for (almost) anyone doing (almost) anything.
There is no "one size fits all" abstraction. That's why everything in Bog is divorced from everything else. Rendering is not tied to window management. User interfacing is not tied to layout. UI elements are not tied to the user interface. You can pick and choose what fits your specific use case best.
I want to provide a set of tools you can use to make your project your project. This is not a framework, it's a toolkit.
Source: quick_start.rs
use bog::prelude::*;
fn main() -> Result<()> {
run_simple_app(None, MyApp)
}
struct MyApp;
impl SimpleApp for MyApp {
type CustomEvent = ();
fn render<'pass>(&'pass mut self, cx: AppContext, pass: &mut RenderPass<'pass>) {
pass.start_layer(cx.renderer.viewport_rect());
pass.fill_quad(Quad {
bounds: cx.renderer.viewport_rect(),
bg_color: Color::new(43, 43, 53, 255),
..Default::default()
});
pass.end_layer();
}
fn input(&mut self, cx: AppContext, _event: InputEvent) {
cx.window.request_redraw();
}
fn window_desc(&self) -> WindowDescriptor {
WindowDescriptor {
title: "Bog - Quickstart Example",
..Default::default()
}
}
}
By default, all features are enabled and available. You can choose which ones you want by setting default-features
to false
in your Cargo.toml
, and then enabling the ones you want:
bog = { version = "*", default-features = false, features = ["window", "render"] }
app
, an easy way to create cross-platform applications.render
, for rendering to surfaces with the GPU.window
, for connecting to the platform's windowing system.