mirror of
https://github.com/FranLMSP/snes.git
synced 2026-08-03 08:30:01 -04:00
sample egui app
This commit is contained in:
@@ -7,3 +7,7 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
snes-core = { path = "../snes-core" }
|
snes-core = { path = "../snes-core" }
|
||||||
|
|
||||||
|
# Frontend stuff
|
||||||
|
eframe = "0.24.1"
|
||||||
|
env_logger = "0.10.1"
|
||||||
|
|||||||
@@ -1,5 +1,23 @@
|
|||||||
use snes_core::emulator::Emulator;
|
use eframe::egui;
|
||||||
|
|
||||||
fn main() {
|
fn main() -> eframe::Result<()> {
|
||||||
let mut emulator = Emulator::new();
|
let native_options = eframe::NativeOptions::default();
|
||||||
|
eframe::run_native("SNES Emulator", native_options, Box::new(|cc| Box::new(SnesEmulatorApp::new(cc))))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
struct SnesEmulatorApp {}
|
||||||
|
|
||||||
|
impl SnesEmulatorApp {
|
||||||
|
fn new(_cc: &eframe::CreationContext<'_>) -> Self {
|
||||||
|
Self::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl eframe::App for SnesEmulatorApp {
|
||||||
|
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
|
||||||
|
egui::CentralPanel::default().show(ctx, |ui| {
|
||||||
|
ui.heading("Hello World!");
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user