Use static dispatch

This commit is contained in:
jtnunley 2022-12-22 10:09:47 -08:00
parent 58d4fd41b7
commit 319ff565a5
7 changed files with 75 additions and 49 deletions

View file

@ -5,7 +5,6 @@ use std::{
str,
};
use crate::GraphicsContextImpl;
use crate::SwBufError;
struct OrbitalMap {
@ -49,10 +48,8 @@ impl OrbitalImpl {
pub fn new(handle: OrbitalWindowHandle) -> Result<Self, SwBufError> {
Ok(Self { handle })
}
}
impl GraphicsContextImpl for OrbitalImpl {
unsafe fn set_buffer(&mut self, buffer: &[u32], width_u16: u16, height_u16: u16) {
pub(crate) unsafe fn set_buffer(&mut self, buffer: &[u32], width_u16: u16, height_u16: u16) {
let window_fd = self.handle.window as usize;
// Read the current width and size