xengui 0.2.0

wgpu based, modern and high-performance GUI library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-License-Identifier: Apache-2.0
use super::{DrawCommand, TextCommand};

pub struct PaintContext<'a> {
    commands: &'a mut Vec<DrawCommand>,
}

impl<'a> PaintContext<'a> {
    pub(crate) fn new(commands: &'a mut Vec<DrawCommand>) -> Self {
        Self { commands }
    }

    pub fn draw_text(&mut self, command: TextCommand) {
        self.commands.push(DrawCommand::Text(command));
    }
}