mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
[epi] Simplify TextureAllocator interface
This commit is contained in:
@@ -190,15 +190,11 @@ pub struct IntegrationInfo {
|
||||
/// How to allocate textures (images) to use in [`egui`].
|
||||
pub trait TextureAllocator {
|
||||
/// Allocate a new user texture.
|
||||
fn alloc(&mut self) -> egui::TextureId;
|
||||
|
||||
/// Set or change the pixels of a user texture.
|
||||
fn set_srgba_premultiplied(
|
||||
fn alloc_srgba_premultiplied(
|
||||
&mut self,
|
||||
id: egui::TextureId,
|
||||
size: (usize, usize),
|
||||
srgba_pixels: &[egui::Color32],
|
||||
);
|
||||
) -> egui::TextureId;
|
||||
|
||||
/// Free the given texture.
|
||||
fn free(&mut self, id: egui::TextureId);
|
||||
|
||||
Reference in New Issue
Block a user