Initial Fyrox project
This commit is contained in:
commit
27d327933e
23 changed files with 5633 additions and 0 deletions
14
editor/Cargo.toml
Normal file
14
editor/Cargo.toml
Normal file
|
@ -0,0 +1,14 @@
|
|||
|
||||
[package]
|
||||
name = "editor"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
fyrox = { workspace = true }
|
||||
fyroxed_base = { workspace = true }
|
||||
red_dragon_pon = { path = "../game", optional = true }
|
||||
|
||||
[features]
|
||||
default = ["red_dragon_pon", "fyroxed_base/default"]
|
||||
dylib = ["fyroxed_base/dylib_engine"]
|
35
editor/src/main.rs
Normal file
35
editor/src/main.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
//! Editor with your game connected to it as a plugin.
|
||||
use fyroxed_base::{fyrox::event_loop::EventLoop, Editor, StartupData, fyrox::core::log::Log};
|
||||
|
||||
fn main() {
|
||||
Log::set_file_name("red_dragon_pon.log");
|
||||
|
||||
let event_loop = EventLoop::new().unwrap();
|
||||
let mut editor = Editor::new(
|
||||
Some(StartupData {
|
||||
working_directory: Default::default(),
|
||||
scenes: vec!["data/scene.rgs".into()],
|
||||
}),
|
||||
);
|
||||
|
||||
// Dynamic linking with hot reloading.
|
||||
#[cfg(feature = "dylib")]
|
||||
{
|
||||
#[cfg(target_os = "windows")]
|
||||
let file_name = "game_dylib.dll";
|
||||
#[cfg(target_os = "linux")]
|
||||
let file_name = "libgame_dylib.so";
|
||||
#[cfg(target_os = "macos")]
|
||||
let file_name = "libgame_dylib.dylib";
|
||||
editor.add_dynamic_plugin(file_name, true, true).unwrap();
|
||||
}
|
||||
|
||||
// Static linking.
|
||||
#[cfg(not(feature = "dylib"))]
|
||||
{
|
||||
use red_dragon_pon::Game;
|
||||
editor.add_game_plugin(Game::default());
|
||||
}
|
||||
|
||||
editor.run(event_loop)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue