Skip to content

Commit

Permalink
Upgrade to rust 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Dec 6, 2018
1 parent 4f94d46 commit d425ced
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "vulkano_text"
version = "0.9.0"
edition = "2018"
authors = ["Rukai <rubickent@gmail.com>"]
description = "Render text with the DejaVu font using the Vulkano library."
license = "MIT"
Expand Down
7 changes: 1 addition & 6 deletions examples/stress_test.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#[macro_use]
extern crate vulkano;
extern crate winit;
extern crate vulkano_win;
extern crate vulkano_text;
use vulkano_text::{DrawText, DrawTextTrait};

use vulkano::command_buffer::AutoCommandBufferBuilder;
Expand Down Expand Up @@ -141,7 +136,7 @@ fn main() {
};

// include a depth buffer (unlike triangle.rs) to ensure vulkano-text isnt dependent on a specific render_pass
let render_pass = Arc::new(single_pass_renderpass!(
let render_pass = Arc::new(vulkano::single_pass_renderpass!(
device.clone(),
attachments: {
color: {
Expand Down
11 changes: 2 additions & 9 deletions examples/triangle.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
// Any difference in code from vulkano triangle.rs example is noted with ALL CAPS COMMENT BLOCKS
// The formatting is different though.

#[macro_use]
extern crate vulkano;
extern crate vulkano_shaders;
extern crate winit;
extern crate vulkano_win;

// IMPORT
extern crate vulkano_text;
use vulkano_text::{DrawText, DrawTextTrait};
// IMPORT END

Expand Down Expand Up @@ -99,7 +92,7 @@ fn main() {
let vertex_buffer = {
#[derive(Debug, Clone)]
struct Vertex { position: [f32; 2] }
impl_vertex!(Vertex, position);
vulkano::impl_vertex!(Vertex, position);

CpuAccessibleBuffer::from_iter(device.clone(), BufferUsage::all(), [
// BIGGER TRIANGLE
Expand All @@ -113,7 +106,7 @@ fn main() {
let vs = vs::Shader::load(device.clone()).unwrap();
let fs = fs::Shader::load(device.clone()).unwrap();

let render_pass = Arc::new(single_pass_renderpass!(
let render_pass = Arc::new(vulkano::single_pass_renderpass!(
device.clone(),
attachments: {
color: {
Expand Down
8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#[macro_use] extern crate vulkano;
extern crate vulkano_shaders;
extern crate rusttype;

use rusttype::{Font, PositionedGlyph, Scale, Rect, point};
use rusttype::gpu_cache::Cache;

Expand All @@ -28,7 +24,7 @@ struct Vertex {
tex_position: [f32; 2],
color: [f32; 4]
}
impl_vertex!(Vertex, position, tex_position, color);
vulkano::impl_vertex!(Vertex, position, tex_position, color);

mod vs {
vulkano_shaders::shader!{
Expand Down Expand Up @@ -74,7 +70,7 @@ impl DrawText {
let cache = Cache::builder().dimensions(CACHE_WIDTH as u32, CACHE_HEIGHT as u32).build();
let cache_pixel_buffer = vec!(0; CACHE_WIDTH * CACHE_HEIGHT);

let render_pass = Arc::new(single_pass_renderpass!(device.clone(),
let render_pass = Arc::new(vulkano::single_pass_renderpass!(device.clone(),
attachments: {
color: {
load: Load,
Expand Down

0 comments on commit d425ced

Please sign in to comment.