aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 197b200..1f5dc8a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -17,11 +17,28 @@ use std::{
17 io::{Cursor, Read}, 17 io::{Cursor, Read},
18}; 18};
19 19
20use log::{error, info};
20use obi::Image; 21use obi::Image;
21 22
22pub fn main() { 23pub fn main() {
23 let sdl_context = sdl2::init().unwrap(); 24 env_logger::init();
24 let ttf_context = sdl2::ttf::init().unwrap(); 25
26 let sdl_context = sdl2::init();
27 if sdl_context.is_err() {
28 error!("Unable to find libsdl2 ... Exiting");
29 return;
30 }
31 let sdl_context = sdl_context.unwrap();
32 info!("Initialized SDL context");
33
34 let ttf_context = sdl2::ttf::init();
35 if ttf_context.is_err() {
36 error!("Unable to find SDL2_ttf ... Exiting");
37 return;
38 }
39 let ttf_context = ttf_context.unwrap();
40 info!("Initialized SDL_ttf context");
41
25 let args: Vec<_> = env::args().collect(); 42 let args: Vec<_> = env::args().collect();
26 if args.len() < 2 { 43 if args.len() < 2 {
27 AppState::init(160, 160, &sdl_context, &ttf_context, None).run(); 44 AppState::init(160, 160, &sdl_context, &ttf_context, None).run();