summaryrefslogtreecommitdiffhomepage
path: root/src/rcore.c
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-13 14:14:16 +0200
committerRay <[email protected]>2023-10-13 14:14:16 +0200
commit2e65bc675ce2ef92ccc784e25739b27edd7be94b (patch)
tree990699cea1923bb5d2f49089b130231249eb3153 /src/rcore.c
parent876e6b3a0d4db8e6124bf8f95d048879f2f760b1 (diff)
downloadraylib-2e65bc675ce2ef92ccc784e25739b27edd7be94b.tar.gz
raylib-2e65bc675ce2ef92ccc784e25739b27edd7be94b.zip
Moved some platforms functions to generic `rcore` #3313
Reviewed `InitWindow()` to clearly note platform specific code
Diffstat (limited to 'src/rcore.c')
-rw-r--r--src/rcore.c53
1 files changed, 41 insertions, 12 deletions
diff --git a/src/rcore.c b/src/rcore.c
index 253436e5..3efa67b2 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -322,18 +322,15 @@ const char *TextFormat(const char *text, ...); // Formatting of text with
//void InitWindow(int width, int height, const char *title)
//void CloseWindow(void)
//bool WindowShouldClose(void)
-//bool IsWindowHidden(void)
-//bool IsWindowMinimized(void)
-//bool IsWindowMaximized(void)
-//bool IsWindowFocused(void)
-//bool IsWindowResized(void)
//void ToggleFullscreen(void)
+//void ToggleBorderlessWindowed(void)
//void MaximizeWindow(void)
//void MinimizeWindow(void)
//void RestoreWindow(void)
-//void ToggleBorderlessWindowed(void)
+
//void SetWindowState(unsigned int flags)
//void ClearWindowState(unsigned int flags)
+
//void SetWindowIcon(Image image)
//void SetWindowIcons(Image *images, int count)
//void SetWindowTitle(const char *title)
@@ -345,25 +342,27 @@ const char *TextFormat(const char *text, ...); // Formatting of text with
//void SetWindowOpacity(float opacity)
//void SetWindowFocused(void)
//void *GetWindowHandle(void)
+//Vector2 GetWindowPosition(void)
+//Vector2 GetWindowScaleDPI(void)
+
//int GetMonitorCount(void)
//int GetCurrentMonitor(void)
-//Vector2 GetMonitorPosition(int monitor)
//int GetMonitorWidth(int monitor)
//int GetMonitorHeight(int monitor)
//int GetMonitorPhysicalWidth(int monitor)
//int GetMonitorPhysicalHeight(int monitor)
//int GetMonitorRefreshRate(int monitor)
+//Vector2 GetMonitorPosition(int monitor)
//const char *GetMonitorName(int monitor)
-//Vector2 GetWindowPosition(void)
-//Vector2 GetWindowScaleDPI(void)
+
//void SetClipboardText(const char *text)
//const char *GetClipboardText(void)
+
//void ShowCursor(void)
//void HideCursor(void)
//void EnableCursor(void)
//void DisableCursor(void)
-
// Check if window has been initialized successfully
bool IsWindowReady(void)
{
@@ -376,6 +375,36 @@ bool IsWindowFullscreen(void)
return CORE.Window.fullscreen;
}
+// Check if window is currently hidden
+bool IsWindowHidden(void)
+{
+ return ((CORE.Window.flags & FLAG_WINDOW_HIDDEN) > 0);
+}
+
+// Check if window has been minimized
+bool IsWindowMinimized(void)
+{
+ return ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0);
+}
+
+// Check if window has been maximized
+bool IsWindowMaximized(void)
+{
+ return ((CORE.Window.flags & FLAG_WINDOW_MAXIMIZED) > 0);
+}
+
+// Check if window has the focus
+bool IsWindowFocused(void)
+{
+ return ((CORE.Window.flags & FLAG_WINDOW_UNFOCUSED) == 0);
+}
+
+// Check if window has been resizedLastFrame
+bool IsWindowResized(void)
+{
+ return CORE.Window.resizedLastFrame;
+}
+
// Check if one specific window flag is enabled
bool IsWindowState(unsigned int flag)
{
@@ -394,13 +423,13 @@ int GetScreenHeight(void)
return CORE.Window.screen.height;
}
-// Get current render width which is equal to screen width * dpi scale
+// Get current render width which is equal to screen width*dpi scale
int GetRenderWidth(void)
{
return CORE.Window.render.width;
}
-// Get current screen height which is equal to screen height * dpi scale
+// Get current screen height which is equal to screen height*dpi scale
int GetRenderHeight(void)
{
return CORE.Window.render.height;