fancy text

This commit is contained in:
2021-08-16 02:27:00 +02:00
parent fb045f210a
commit 00d6d1c5f8
13 changed files with 52 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
use std::{convert::TryInto, io::{self, ErrorKind, Read, Write}, path::PathBuf, sync::Arc};
use vulkano::{command_buffer::AutoCommandBufferBuilder, descriptor::{descriptor::ShaderStages, descriptor_set::PersistentDescriptorSet}, pipeline::shader::{ShaderModule}};
use vulkano::{command_buffer::AutoCommandBufferBuilder, descriptor::{descriptor::ShaderStages, descriptor_set::PersistentDescriptorSet}, pipeline::{shader::{ShaderModule}}};
use vulkano::command_buffer::DynamicState;
use vulkano::device::Device;
use vulkano::framebuffer::RenderPassAbstract;
@@ -9,7 +9,7 @@ use vulkano::pipeline::GraphicsPipeline;
use vulkano::pipeline::GraphicsPipelineAbstract;
use vulkano::pipeline::shader::GraphicsShaderType;
use crate::{GameObject, vulkan::TextVertex};
use crate::{GameObject, vulkan::{TextVertex}};
use crate::vulkan::{LinePoint, Vertex};
use crate::vulkan::GameData;
use crate::VulkanRenderer;
@@ -230,7 +230,7 @@ impl LineShader {
}
impl Drawcall for LineShader {
fn draw(self: &Self, builder: &mut AutoCommandBufferBuilder, _fb_index: usize, game_objects: Vec<&GameObject>, game_data: &GameData, dynamic_state: &DynamicState) {
fn draw(self: &Self, builder: &mut AutoCommandBufferBuilder, _fb_index: usize, _game_objects: Vec<&GameObject>, game_data: &GameData, dynamic_state: &DynamicState) {
builder.draw(self.pipeline.clone(),
&dynamic_state,
vec![self.vertex_buffer.clone()],
@@ -302,7 +302,7 @@ impl TextShader {
..ShaderStages::none()
});
let vs_entry = vs_module.graphics_entry_point(entry_name_c, vs_text::MainInput, vs_text::MainOutput, vs_layout, GraphicsShaderType::Vertex);
let gp = Arc::new(GraphicsPipeline::start()
.vertex_input_single_buffer::<TextVertex>()
.vertex_shader(vs_entry, ())
@@ -311,7 +311,7 @@ impl TextShader {
.depth_stencil_simple_depth()
.fragment_shader(fs_entry, ())
.blend_alpha_blending()
.cull_mode_back()
.cull_mode_disabled()
.render_pass(sub_pass.clone())
.build(device.clone())
.unwrap());