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]
engine = { path = "../Gavania/engine", features = ["graphical"] }
assetpath = { git = "https://gavania.de/hodasemi/vulkan_lib.git" }
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<()> {
match event {
EngineEvent::MouseMotion(_, _) => todo!(),
EngineEvent::MouseButtonDown(_) => todo!(),
EngineEvent::MouseButtonUp(_) => todo!(),
EngineEvent::MouseWheel(_, _, _) => todo!(),
EngineEvent::KeyDown(_) => todo!(),
EngineEvent::KeyUp(_) => todo!(),
EngineEvent::ButtonDown(_) => todo!(),
EngineEvent::ButtonUp(_) => todo!(),
EngineEvent::ControllerAxis(_) => todo!(),
EngineEvent::ControllerAdded(_) => todo!(),
EngineEvent::ControllerRemoved(_) => todo!(),
EngineEvent::FileDrop(_) => todo!(),
EngineEvent::MouseMotion(_, _) => (),
EngineEvent::MouseButtonDown(_) => (),
EngineEvent::MouseButtonUp(_) => (),
EngineEvent::MouseWheel(_, _, _) => (),
EngineEvent::KeyDown(_) => (),
EngineEvent::KeyUp(_) => (),
EngineEvent::ButtonDown(_) => (),
EngineEvent::ButtonUp(_) => (),
EngineEvent::ControllerAxis(_) => (),
EngineEvent::ControllerAdded(_) => (),
EngineEvent::ControllerRemoved(_) => (),
EngineEvent::FileDrop(_) => (),
}
Ok(())

View file

@ -2,12 +2,25 @@ mod board;
mod game;
use anyhow::Result;
use assetpath::AssetPath;
use engine::prelude::*;
use game::MillGame;
fn main() -> Result<()> {
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)?;