mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-12 14:28:15 +00:00
Reworking API upon suggestion.
This commit is contained in:
@@ -15,8 +15,9 @@ 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 void ShowWindow(); // Show the window
|
||||||
RLAPI bool IsWindowVisible(); // Check if window is currently visible
|
RLAPI void HideWindow(); // Hide the window
|
||||||
|
RLAPI bool IsWindowHidden(); // Check if window is currently hidden
|
||||||
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
|
||||||
|
|
||||||
|
23
src/core.c
23
src/core.c
@@ -831,22 +831,29 @@ void SetWindowSize(int width, int height)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window visibility
|
// Show the window
|
||||||
void SetWindowVisible(bool visible)
|
void ShowWindow()
|
||||||
{
|
{
|
||||||
#if defined(PLATFORM_DESKTOP)
|
#if defined(PLATFORM_DESKTOP)
|
||||||
if (visible) glfwShowWindow(window);
|
glfwShowWindow(window);
|
||||||
else glfwHideWindow(window);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window visibility
|
// Hide the window
|
||||||
bool IsWindowVisible()
|
void HideWindow()
|
||||||
{
|
{
|
||||||
#if defined(PLATFORM_DESKTOP)
|
#if defined(PLATFORM_DESKTOP)
|
||||||
return glfwGetWindowAttrib(window, GLFW_VISIBLE) != GL_FALSE;
|
glfwHideWindow(window);
|
||||||
#endif
|
#endif
|
||||||
return true;
|
}
|
||||||
|
|
||||||
|
// Check if window is currently hidden
|
||||||
|
bool IsWindowHidden()
|
||||||
|
{
|
||||||
|
#if defined(PLATFORM_DESKTOP)
|
||||||
|
return glfwGetWindowAttrib(window, GLFW_VISIBLE) == GL_FALSE;
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current screen width
|
// Get current screen width
|
||||||
|
@@ -827,8 +827,9 @@ 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 void ShowWindow(); // Show the window
|
||||||
RLAPI bool IsWindowVisible(); // Check if window is currently visible
|
RLAPI void HideWindow(); // Hide the window
|
||||||
|
RLAPI bool IsWindowHidden(); // Check if window is currently hidden
|
||||||
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
|
||||||
|
Reference in New Issue
Block a user