瀏覽代碼

Adding window visibility functions.

pull/719/head
Marco Lizza 6 年之前
父節點
當前提交
a15251bcdb
共有 2 個文件被更改,包括 20 次插入0 次删除
  1. +18
    -0
      src/core.c
  2. +2
    -0
      src/raylib.h

+ 18
- 0
src/core.c 查看文件

@ -831,6 +831,24 @@ void SetWindowSize(int width, int height)
#endif #endif
} }
// Set window visibility
void SetWindowVisible(bool visible)
{
#if defined(PLATFORM_DESKTOP)
if (visible) glfwShowWindow(window);
else glfwHideWindow(window);
#endif
}
// Set window visibility
bool IsWindowVisible()
{
#if defined(PLATFORM_DESKTOP)
return glfwGetWindowAttrib(window, GLFW_VISIBLE) != GL_FALSE;
#endif
return true;
}
// Get current screen width // Get current screen width
int GetScreenWidth(void) int GetScreenWidth(void)
{ {

+ 2
- 0
src/raylib.h 查看文件

@ -827,6 +827,8 @@ RLAPI void SetWindowPosition(int x, int y); // Set window
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 void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
RLAPI void SetWindowSize(int width, int height); // Set window dimensions RLAPI void SetWindowSize(int width, int height); // Set window dimensions
RLAPI void SetWindowVisible(bool visible); // Set window visibility
RLAPI bool IsWindowVisible(); // Check if window is currently visible
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
RLAPI void *GetWindowHandle(void); // Get native window handle RLAPI void *GetWindowHandle(void); // Get native window handle

Loading…
取消
儲存