1
0
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:
Emil Ernerfeldt
2021-01-07 16:29:58 +01:00
parent e8e53e9500
commit 5ef9f35d1e
6 changed files with 20 additions and 27 deletions

View File

@@ -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);