PacktPublishing / Vulkan-Cookbook

Code repository for Vulkan Cookbook by Packt
MIT License
816 stars 109 forks source link

image_size.width & height ==0 returns true when should return false - line 69 in Chapter 2 recipe 14 #20

Open JoeImplode opened 12 months ago

JoeImplode commented 12 months ago

In CreateSwapchainWithR8G8B8A8FormatAndMailboxPresentMode() (Chapter 2 recipe 14) on line 69 there is a conditional statement which checks if our iamge_size's width and height for our swapchain images is == 0, this returns true if so, no doubt this should be return false as is the case with the rest of the conditional statements in this function.

if( (0 == image_size.width) ||
    (0 == image_size.height) ) {
  return true;
}

Change to:

if( (0 == image_size.width) ||
    (0 == image_size.height) ) {
  return false;
}