Add 's' to dimension in Swapchain::recreate_with_dimension (#1315)

This commit is contained in:
José Miguel Sánchez García 2020-01-31 23:37:06 +01:00 committed by GitHub
parent dd7b202e80
commit c620aefd29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 12 additions and 11 deletions

View File

@ -1,5 +1,6 @@
# Version 0.17.0 (TBA)
- **Breaking** Swapchain::recreate_with_dimension() is now Swapchain::recreate_with_dimensions()
- **Breaking** Sync::SharingMode::Exclusive(queue_family: u32) is now Sync::SharingMode::Exclusive.
- **Breaking** Added Swapchain::with_old_swapchain() - same as previous Swapchain::new(), if an oldswapchain needs to be used
- **Breaking** Swapchain::new() now doesnt need to have the old_swapchain parameter anymore but requires the ColorSpace

View File

@ -101,7 +101,7 @@ fn main() {
if recreate_swapchain {
let dimensions: [u32; 2] = surface.window().inner_size().into();
let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) {
let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) {
Ok(r) => r,
Err(SwapchainCreationError::UnsupportedDimensions) => return,
Err(e) => panic!("Failed to recreate swapchain: {:?}", e)

View File

@ -162,7 +162,7 @@ fn main() {
if recreate_swapchain {
let dimensions: [u32; 2] = surface.window().inner_size().into();
let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) {
let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) {
Ok(r) => r,
Err(SwapchainCreationError::UnsupportedDimensions) => return,
Err(e) => panic!("Failed to recreate swapchain: {:?}", e)

View File

@ -219,7 +219,7 @@ fn main() {
if recreate_swapchain {
let dimensions: [u32; 2] = surface.window().inner_size().into();
let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) {
let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) {
Ok(r) => r,
Err(SwapchainCreationError::UnsupportedDimensions) => return,
Err(e) => panic!("Failed to recreate swapchain: {:?}", e)

View File

@ -208,7 +208,7 @@ fn main() {
if recreate_swapchain {
let dimensions: [u32; 2] = surface.window().inner_size().into();
let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) {
let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) {
Ok(r) => r,
Err(SwapchainCreationError::UnsupportedDimensions) => return,
Err(e) => panic!("Failed to recreate swapchain: {:?}", e)

View File

@ -216,7 +216,7 @@ fn main() {
if *recreate_swapchain {
let dimensions: [u32; 2] = surface.window().inner_size().into();
let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) {
let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) {
Ok(r) => r,
Err(SwapchainCreationError::UnsupportedDimensions) => return,
Err(e) => panic!("Failed to recreate swapchain: {:?}", e)

View File

@ -396,7 +396,7 @@ fn main() {
if recreate_swapchain {
let dimensions: [u32; 2] = surface.window().inner_size().into();
let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) {
let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) {
Ok(r) => r,
Err(SwapchainCreationError::UnsupportedDimensions) => return,
Err(e) => panic!("Failed to recreate swapchain: {:?}", e)

View File

@ -130,7 +130,7 @@ fn main() {
if recreate_swapchain {
let dimensions: [u32; 2] = surface.window().inner_size().into();
let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) {
let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) {
Ok(r) => r,
Err(SwapchainCreationError::UnsupportedDimensions) => return,
Err(e) => panic!("Failed to recreate swapchain: {:?}", e)

View File

@ -238,7 +238,7 @@ fn main() {
if recreate_swapchain {
let dimensions: [u32; 2] = surface.window().inner_size().into();
let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) {
let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) {
Ok(r) => r,
Err(SwapchainCreationError::UnsupportedDimensions) => return,
Err(e) => panic!("Failed to recreate swapchain: {:?}", e)

View File

@ -324,7 +324,7 @@ fn main() {
if recreate_swapchain {
// Get the new dimensions of the window.
let dimensions: [u32; 2] = surface.window().inner_size().into();
let (new_swapchain, new_images) = match swapchain.recreate_with_dimension(dimensions) {
let (new_swapchain, new_images) = match swapchain.recreate_with_dimensions(dimensions) {
Ok(r) => r,
// This error tends to happen when the user is manually resizing the window.
// Simply restarting the loop is the easiest way to fix this issue.

View File

@ -276,7 +276,7 @@
//!
//! loop {
//! if recreate_swapchain {
//! swapchain = swapchain.0.recreate_with_dimension([1024, 768]).unwrap();
//! swapchain = swapchain.0.recreate_with_dimensions([1024, 768]).unwrap();
//! recreate_swapchain = false;
//! }
//!

View File

@ -295,7 +295,7 @@ impl <W> Swapchain<W> {
}
/// Recreates the swapchain with new dimensions.
pub fn recreate_with_dimension(
pub fn recreate_with_dimensions(
&self, dimensions: [u32; 2])
-> Result<(Arc<Swapchain<W>>, Vec<Arc<SwapchainImage<W>>>), SwapchainCreationError> {
Swapchain::new_inner(self.device.clone(),