This commit is contained in:
LunarAkai 2025-08-29 00:10:03 +02:00
commit 2673a31b81
5 changed files with 37 additions and 14 deletions

View file

@ -4,13 +4,13 @@ use std::{
rc::Rc,
};
use glium::SwapBuffersError;
use glium::{SwapBuffersError, winit::window::Window};
use moonhare_window::glfw::Context;
// adopted from the glium repo -> examples -> manual_creation.rs
#[derive(Clone)]
pub struct Backend {
pub gl_window: Rc<RefCell<moonhare_window::glfw::PWindow>>,
pub gl_window: Rc<RefCell<Box<Window>>>,
}
unsafe impl glium::backend::Backend for Backend {

View file

@ -9,6 +9,7 @@ use std::{
use glium::{
Frame, Surface,
backend::{Context, Facade},
winit::window::Window,
};
use lazy_static::lazy_static;
use moonhare_window::glfw::PWindow;
@ -21,8 +22,8 @@ use state::InitCell;
use crate::color::Color;
pub fn build_context(window: Rc<RefCell<PWindow>>) -> Rc<Context> {
let gl_window: Rc<RefCell<PWindow>> = window;
pub fn build_context(window: Rc<RefCell<Box<Window>>>) -> Rc<Context> {
let gl_window = window;
// now building the context
let context = unsafe {