diagramming out what I want to do here. CanvasFont will live with the buffers. Need to figure out how and where I'm going to query the font data for rendering

This commit is contained in:
2019-10-09 20:44:56 -07:00
parent b1b081af87
commit e5ba27c353
7 changed files with 136 additions and 208 deletions

View File

@@ -5,9 +5,10 @@ use vulkano::format::{Format, R8Unorm};
use vulkano::sampler::Sampler;
use vulkano::descriptor::DescriptorSet;
use vulkano::descriptor::descriptor_set::PersistentDescriptorSet;
use vulkano::buffer::CpuAccessibleBuffer;
use vulkano::buffer::{CpuAccessibleBuffer, BufferAccess};
use vulkano::pipeline::GraphicsPipelineAbstract;
use crate::canvas::canvas_text::CanvasFontHandle;
use rusttype::Font;
#[derive(Clone)]
pub struct CanvasTexture {
@@ -52,10 +53,15 @@ impl CanvasImage {
}
#[derive(Clone)]
pub struct CanvasText {
pub struct CanvasFont {
pub(crate) handle: Arc<CanvasImageHandle>,
pub(crate) buffer: Arc<(dyn BufferAccess + Send + Sync)>, // Font atlas
pub(crate) font: Font<'static>,
pub(crate) name: String,
}
impl CanvasText {
impl CanvasFont {
pub fn get_descriptor_set(pipeline: Arc<dyn GraphicsPipelineAbstract + Sync + Send>)
-> Box<dyn DescriptorSet + Send + Sync> {
let o: Box<dyn DescriptorSet + Send + Sync> = Box::new(