mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-26 08:44:36 +00:00
removed dependency on std::min & std::max
This commit is contained in:
parent
83d58fc6d4
commit
14541f447c
@ -932,6 +932,9 @@ VkPresentModeKHR find_present_mode (std::vector<VkPresentModeKHR> const& availab
|
|||||||
return VK_PRESENT_MODE_FIFO_KHR;
|
return VK_PRESENT_MODE_FIFO_KHR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T> T minimum (T a, T b) { return a < b ? a : b; }
|
||||||
|
template <typename T> T maximum (T a, T b) { return a > b ? a : b; }
|
||||||
|
|
||||||
VkExtent2D find_extent (
|
VkExtent2D find_extent (
|
||||||
VkSurfaceCapabilitiesKHR const& capabilities, uint32_t desired_width, uint32_t desired_height) {
|
VkSurfaceCapabilitiesKHR const& capabilities, uint32_t desired_width, uint32_t desired_height) {
|
||||||
if (capabilities.currentExtent.width != UINT32_MAX) {
|
if (capabilities.currentExtent.width != UINT32_MAX) {
|
||||||
@ -941,10 +944,10 @@ VkExtent2D find_extent (
|
|||||||
const int HEIGHT = 600;
|
const int HEIGHT = 600;
|
||||||
VkExtent2D actualExtent = { WIDTH, HEIGHT };
|
VkExtent2D actualExtent = { WIDTH, HEIGHT };
|
||||||
|
|
||||||
actualExtent.width = std::max (capabilities.minImageExtent.width,
|
actualExtent.width = maximum (capabilities.minImageExtent.width,
|
||||||
std::min (capabilities.maxImageExtent.width, actualExtent.width));
|
minimum (capabilities.maxImageExtent.width, actualExtent.width));
|
||||||
actualExtent.height = std::max (capabilities.minImageExtent.height,
|
actualExtent.height = maximum (capabilities.minImageExtent.height,
|
||||||
std::min (capabilities.maxImageExtent.height, actualExtent.height));
|
minimum (capabilities.maxImageExtent.height, actualExtent.height));
|
||||||
|
|
||||||
return actualExtent;
|
return actualExtent;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user