Explorar o código

Merge branch 'develop' of https://github.com/raysan5/raylib into develop

Ray %!s(int64=8) %!d(string=hai) anos
pai
achega
9c66d961d0
Modificáronse 2 ficheiros con 10 adicións e 0 borrados
  1. 9 0
      src/core.c
  2. 1 0
      src/raylib.h

+ 9 - 0
src/core.c

@@ -629,6 +629,15 @@ void SetWindowMonitor(int monitor)
 #endif
 #endif
 }
 }
 
 
+// Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
+void SetWindowMinSize(int width, int height)
+{
+#if defined(PLATFORM_DESKTOP)
+    const GLFWvidmode *mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
+    glfwSetWindowSizeLimits(window, width, height, mode->width, mode->height);
+#endif
+}
+
 // Get current screen width
 // Get current screen width
 int GetScreenWidth(void)
 int GetScreenWidth(void)
 {
 {

+ 1 - 0
src/raylib.h

@@ -667,6 +667,7 @@ RLAPI void ToggleFullscreen(void);                                // Fullscreen
 RLAPI void SetWindowIcon(Image image);                            // Set icon for window (only PLATFORM_DESKTOP)
 RLAPI void SetWindowIcon(Image image);                            // Set icon for window (only PLATFORM_DESKTOP)
 RLAPI void SetWindowPosition(int x, int y);                       // Set window position on screen (only PLATFORM_DESKTOP)
 RLAPI void SetWindowPosition(int x, int y);                       // Set window position on screen (only PLATFORM_DESKTOP)
 RLAPI void SetWindowMonitor(int monitor);                         // Set monitor for the current window (fullscreen mode)
 RLAPI void SetWindowMonitor(int monitor);                         // Set monitor for the current window (fullscreen mode)
+RLAPI void SetWindowMinSize(int width, int height);               // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
 RLAPI int GetScreenWidth(void);                                   // Get current screen width
 RLAPI int GetScreenWidth(void);                                   // Get current screen width
 RLAPI int GetScreenHeight(void);                                  // Get current screen height
 RLAPI int GetScreenHeight(void);                                  // Get current screen height