1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::communication::Sprite;
use crate::error::ClientError;
use rask_engine::resources::texture::Texture;
pub trait GraphicsApi: Sized {
type GraphicsError: std::fmt::Display;
fn new(width: u32, height: u32) -> Result<Self, ClientError>;
fn update_sprite_vector(&mut self, sprites: &[Sprite]) -> Result<(), ClientError>;
fn upload_textures(&mut self, textures: &[(u32, u64, &Texture)]) -> Result<(), ClientError>;
fn remove_textures(&mut self) -> Result<(), ClientError>;
fn draw(&mut self) -> Result<(), ClientError>;
fn set_size(&mut self, w: u32, h: u32);
fn update_size(&mut self, w: u32, h: u32);
fn ok(&self) -> Result<(), Self::GraphicsError>;
}