Get application to open a window

This commit is contained in:
hodasemi 2023-05-08 21:24:12 +02:00
parent 3f762fde47
commit a762f37194
6 changed files with 27 additions and 13 deletions

View file

@ -7,6 +7,7 @@ edition = "2021"
[dependencies] [dependencies]
engine = { path = "../Gavania/engine", features = ["graphical"] } engine = { path = "../Gavania/engine", features = ["graphical"] }
assetpath = { git = "https://gavania.de/hodasemi/vulkan_lib.git" }
anyhow = { version = "1.0.70", features = ["backtrace"] } anyhow = { version = "1.0.70", features = ["backtrace"] }

BIN
resources/ExportedFont.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
resources/button_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
resources/button_light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View file

@ -34,18 +34,18 @@ impl EngineObject for MillGame {
fn event(&self, event: EngineEvent) -> Result<()> { fn event(&self, event: EngineEvent) -> Result<()> {
match event { match event {
EngineEvent::MouseMotion(_, _) => todo!(), EngineEvent::MouseMotion(_, _) => (),
EngineEvent::MouseButtonDown(_) => todo!(), EngineEvent::MouseButtonDown(_) => (),
EngineEvent::MouseButtonUp(_) => todo!(), EngineEvent::MouseButtonUp(_) => (),
EngineEvent::MouseWheel(_, _, _) => todo!(), EngineEvent::MouseWheel(_, _, _) => (),
EngineEvent::KeyDown(_) => todo!(), EngineEvent::KeyDown(_) => (),
EngineEvent::KeyUp(_) => todo!(), EngineEvent::KeyUp(_) => (),
EngineEvent::ButtonDown(_) => todo!(), EngineEvent::ButtonDown(_) => (),
EngineEvent::ButtonUp(_) => todo!(), EngineEvent::ButtonUp(_) => (),
EngineEvent::ControllerAxis(_) => todo!(), EngineEvent::ControllerAxis(_) => (),
EngineEvent::ControllerAdded(_) => todo!(), EngineEvent::ControllerAdded(_) => (),
EngineEvent::ControllerRemoved(_) => todo!(), EngineEvent::ControllerRemoved(_) => (),
EngineEvent::FileDrop(_) => todo!(), EngineEvent::FileDrop(_) => (),
} }
Ok(()) Ok(())

View file

@ -2,12 +2,25 @@ mod board;
mod game; mod game;
use anyhow::Result; use anyhow::Result;
use assetpath::AssetPath;
use engine::prelude::*; use engine::prelude::*;
use game::MillGame; use game::MillGame;
fn main() -> Result<()> { fn main() -> Result<()> {
let mut create_info = EngineCreateInfo::default(); let mut create_info = EngineCreateInfo::default();
create_info.resource_base_path = "".to_string();
create_info.resource_base_path = "resources".to_string();
create_info.gui_info.font = Font::Path(AssetPath::from(("resources", "ExportedFont.png")));
create_info.gui_info.menu_button = AssetPath::from("button_dark.png");
create_info.gui_info.menu_button_selected = AssetPath::from("button_light.png");
create_info.gui_info.resource_directory =
AssetPath::from((create_info.resource_base_path.as_str(), ""));
create_info.graphics_info.render_scale = 1.0;
create_info.window_info.height = 600;
create_info.window_info.width = 800;
let engine = Engine::new(create_info)?; let engine = Engine::new(create_info)?;