This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use crate::{ | |
color::*, | |
mesh::{self, Mesh, Vertex}, | |
sprite::*, | |
texture::*, | |
window::*, | |
}; | |
use backend; | |
use gfx_hal::{ | |
adapter::{Adapter, PhysicalDevice}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FRAGMENT: | |
#version 450 | |
#extension GL_ARB_separate_shader_objects : enable | |
layout(location = 0) in vec4 fragColor; | |
layout(location = 1) in vec2 fragUv; | |
layout(location = 0) out vec4 target; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[cfg(windows)] | |
extern crate gfx_backend_dx12 as backend; | |
#[cfg(target_os = "macos")] | |
extern crate gfx_backend_metal as backend; | |
#[cfg(all(unix, not(target_os = "macos")))] | |
extern crate gfx_backend_vulkan as backend; | |
extern crate gfx_hal; | |
extern crate nalgebra_glm as glm; | |
extern crate winit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create texture | |
let (texture_image, texture_memory, texture_view, texture_sampler) = { | |
let img = image::open("res/textures/costanza.png") | |
.expect("Failed to load image!") | |
.to_rgba(); | |
let (width, height) = img.dimensions(); | |
let (texture_image, texture_memory, texture_view) = create_image( |