1786015434

This commit is contained in:
2026-08-06 13:23:54 +02:00
parent e7ad75545d
commit 2d7a0be65b
2 changed files with 12 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
use std::rc::Rc; use std::rc::Rc;
use evdev::KeyCode; use evdev::KeyCode;
use linfb::shape::Color;
use slint::LogicalPosition; use slint::LogicalPosition;
use slint::platform::software_renderer::{MinimalSoftwareWindow, RepaintBufferType}; use slint::platform::software_renderer::{MinimalSoftwareWindow, RepaintBufferType};
use slint::platform::{Platform, WindowEvent}; use slint::platform::{Platform, WindowEvent};
@@ -70,14 +71,19 @@ impl Platform for Trekstor {
self.window.draw_if_needed(|renderer| { self.window.draw_if_needed(|renderer| {
dbg!("Rendering"); dbg!("Rendering");
renderer.render(&mut buffer1, ctx.screen.width() as usize); renderer.render(&mut buffer1, ctx.screen.width() as usize);
for (i, px) in buffer1.into_iter().enumerate() {
let x = (i % ctx.screen.width() as usize) as u32;
let y = (i / ctx.screen.width() as usize) as u32;
// ctx ctx.screen.framebuffer.set_pixel(
// .screen x,
// .fill_contiguous(&ctx.screen.rect(), buffer1) y,
// .ok(); Color::from((px.r(), px.b(), px.b(), px.a())),
);
}
ctx.screen.flush();
}); });
ctx.screen.flush();
ctx.input.finish(); ctx.input.finish();
} }
} }

View File

@@ -4,7 +4,7 @@ use linfb::{Framebuffer, shape::Color};
use crate::rgba::Rgba; use crate::rgba::Rgba;
pub struct Screen { pub struct Screen {
framebuffer: Framebuffer, pub framebuffer: Framebuffer,
width: u32, width: u32,
height: u32, height: u32,
} }