diff options
| author | Ray <raysan5@gmail.com> | 2019-03-04 22:58:20 +0100 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2019-03-04 22:58:20 +0100 |
| commit | 2e99c6cefbaacf03d71ad10c03a60fbb49c46aa1 (patch) | |
| tree | cec2eaf890be3f52e98255113d3d071e7b3c7f27 /src/core.c | |
| parent | d7fd6e0f1a4106690af7901173f421ea2fb1ea40 (diff) | |
| download | raylib-2e99c6cefbaacf03d71ad10c03a60fbb49c46aa1.tar.gz raylib-2e99c6cefbaacf03d71ad10c03a60fbb49c46aa1.zip | |
ADDED: IsWindowResized()
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -273,6 +273,7 @@ static GLFWwindow *window; // Native window (graphic device #endif static bool windowReady = false; // Check if window has been initialized successfully static bool windowMinimized = false; // Check if window has been minimized +static bool windowResized = false; // Check if window has been resized static const char *windowTitle = NULL; // Window text title... static unsigned int displayWidth, displayHeight;// Display width and height (monitor, device-screen, LCD, ...) @@ -742,6 +743,16 @@ bool IsWindowMinimized(void) #endif } +// Check if window has been resized +bool IsWindowResized(void) +{ +#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) || defined(PLATFORM_UWP) + return windowResized; +#else + return false; +#endif +} + // Check if window is currently hidden bool IsWindowHidden(void) { @@ -3137,6 +3148,8 @@ static void PollInputEvents(void) gamepadAxisCount = axisCount; } } + + windowResized = false; #if defined(SUPPORT_EVENTS_WAITING) glfwWaitEvents(); @@ -3414,6 +3427,8 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height) currentHeight = height; // NOTE: Postprocessing texture is not scaled to new size + + windowResized = true; } // GLFW3 WindowIconify Callback, runs when window is minimized/restored |
