implemented render backend

This commit is contained in:
LunarAkai 2025-08-03 17:59:47 +02:00
commit f5e9bca56b
10 changed files with 310 additions and 474 deletions

View file

@ -7,6 +7,4 @@ authors.workspace = true
[dependencies]
moonhare_log = { path = "../moonhare_log" }
moonhare_event = { path = "../moonhare_event" }
gtk4 = "*"
winit = "0.30"
glfw = "*"

View file

@ -24,7 +24,6 @@ pub struct Window {
impl Window {
/// creates a glfw window while spawning a new thread that the window runs on.
#[cfg(target_os = "linux")]
pub fn create(context: WindowRenderContext) -> GLFWWindow {
match context {

View file

@ -1,8 +1,7 @@
use std::sync::Arc;
use glfw::{Context, Glfw, GlfwReceiver, PWindow, WindowEvent};
use gtk4::gdk::Key;
use moonhare_event::{event::{self, Event}, events::window_events::window_close_event::WindowCloseEvent};
use moonhare_event::{event::Event, events::window_events::window_close_event::WindowCloseEvent};
use crate::{window_config, MoonhareWindow};
@ -23,7 +22,7 @@ impl GLFWWindow {
let (mut window, events) = glfw.create_window(
config.width,
config.height,
format!("{} GLFW", config.title).as_str(),
format!("{} GLFW {}", config.title, glfw::get_version_string()).as_str(),
glfw::WindowMode::Windowed)
.unwrap();
@ -39,7 +38,7 @@ impl GLFWWindow {
}
pub fn handle_window_event(window: &mut glfw::Window, event: glfw::WindowEvent) {
pub fn handle_window_event(_window: &mut glfw::Window, event: glfw::WindowEvent) {
match event {
glfw::WindowEvent::Close => {
WindowCloseEvent::emit();