[gpu] Add GPU impl

This commit is contained in:
2024-02-19 09:09:21 +05:30
parent 61c05516b5
commit a7d55cb2b8
2 changed files with 31 additions and 16 deletions

View File

@@ -1,17 +1,17 @@
use crate::emu::graphics::{DEVICE_FRAMEBUFFER_SIZE, GraphicsProcessor};
use std::cell::Ref;
use std::fmt::Debug;
use crate::misc::result::EmulatorResult;
pub trait GraphicsAdapter{
fn draw(&mut self,frame_buf:&[u8;DEVICE_FRAMEBUFFER_SIZE])->EmulatorResult<()>;
pub trait GraphicsAdapter: Debug {
fn draw(&self, frame_buf: Ref<Box<[u8; 65536]>>) -> EmulatorResult<()>;
}
#[derive(Debug, Clone)]
pub struct SDLGraphicsAdapter{
graphics_processor: GraphicsProcessor
pub struct SDLGraphicsAdapter {
}
impl GraphicsAdapter for SDLGraphicsAdapter{
fn draw(&mut self, frame_buf: &[u8; DEVICE_FRAMEBUFFER_SIZE]) -> EmulatorResult<()> {
impl GraphicsAdapter for SDLGraphicsAdapter {
fn draw(&self, frame_buffer: Ref<Box<[u8; 65536]>>) -> EmulatorResult<()> {
todo!()
}
}