1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! # Bottomless-pit
//! Bottomless-pit is a simple 2D game engine that is still a work in progress.
//! This library is inspired slightly by Raylib and other rust based game engines like GGEZ.
//! All Bottomless-pit does currently is handle keyboard and mouse input while also providing
//! a simple way to draw objects to the screen. The shape and texutre renderer is written
//! in house, but the text rendering is powered by [glyphon](https://github.com/grovesNL/glyphon).
//!
//! To get started start by implmenting the Game trait on any struct you like
//! ```rust,no_run
//! use bottomless_pit::Game;
//! use bottomless_pit::engine_handle::{Engine, EngineBuilder};
//! use bottomless_pit::render::RenderInformation;
//!
//! fn main() {
//! let engine = EngineBuilder::new()
//! .build()
//! .expect("Failed to create the engine!");
//! let game = CoolGame::new(&mut engine);
//!
//! engine.run(game);
//! }
//!
//! struct CoolGame {
//! // put whatever you want here
//! }
//!
//! impl CoolGame {
//! pub fn new(engine_handle: &mut Engine) {
//! // you can even load assets before the game opens
//! }
//! }
//!
//! impl Game for CoolGame {
//! fn render<'o>(&'o mut self, mut render_handle: RenderHandle<'o>) {
//! // render what ever you want
//! }
//! fn update(&mut self, engine_handle: &mut Engine) {
//! // this is where all your logic should go
//! }
//! }
use Engine;
use RenderHandle;
use Vec2;
/// The Trait needed for structs to be used in with the Engine
// just the data for png of a white pixel didnt want it in a seperate file so here is a hard coded const!
const WHITE_PIXEL: & = &;
const ERROR_TEXTURE_DATA: & = include_bytes!;