Skip to content

Commit 0252ce0

Browse files
thpOverv
authored andcommitted
Use std::numeric_limits<uint32_t>::max()
1 parent 9fe64f9 commit 0252ce0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

en/03_Drawing_a_triangle/01_Presentation/01_Swap_chain.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,14 @@ for us, we can't just use the original `{WIDTH, HEIGHT}`. Instead, we must use
338338
matching it against the minimum and maximum image extent.
339339

340340
```c++
341-
#include <cstdint> // Necessary for UINT32_MAX
341+
#include <cstdint> // Necessary for uint32_t
342+
#include <limits> // Necessary for std::numeric_limits
342343
#include <algorithm> // Necessary for std::clamp
343344

344345
...
345346

346347
VkExtent2D chooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities) {
347-
if (capabilities.currentExtent.width != UINT32_MAX) {
348+
if (capabilities.currentExtent.width != std::numeric_limits<uint32_t>::max()) {
348349
return capabilities.currentExtent;
349350
} else {
350351
int width, height;

0 commit comments

Comments
 (0)