Browse Source

Reworking API upon suggestion.

pull/719/head
Marco Lizza 6 years ago
parent
commit
6056a2a5cf
3 changed files with 21 additions and 12 deletions
  1. +3
    -2
      projects/Notepad++/raylib_npp_parser/raylib_to_parse.h
  2. +15
    -8
      src/core.c
  3. +3
    -2
      src/raylib.h

+ 3
- 2
projects/Notepad++/raylib_npp_parser/raylib_to_parse.h View File

@ -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 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 SetWindowVisible(bool visible); // Set window visibility
RLAPI bool IsWindowVisible(); // Check if window is currently visible
RLAPI void ShowWindow(); // Show the window
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 GetScreenHeight(void); // Get current screen height

+ 15
- 8
src/core.c View File

@ -831,22 +831,29 @@ void SetWindowSize(int width, int height)
#endif
}
// Set window visibility
void SetWindowVisible(bool visible)
// Show the window
void ShowWindow()
{
#if defined(PLATFORM_DESKTOP)
if (visible) glfwShowWindow(window);
else glfwHideWindow(window);
glfwShowWindow(window);
#endif
}
// Set window visibility
bool IsWindowVisible()
// Hide the window
void HideWindow()
{
#if defined(PLATFORM_DESKTOP)
k">return glfwGetWindowAttrib(window, GLFW_VISIBLE) != GL_FALSE;
n">glfwHideWindow(window);
#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

+ 3
- 2
src/raylib.h View File

@ -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 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 SetWindowVisible(bool visible); // Set window visibility
RLAPI bool IsWindowVisible(); // Check if window is currently visible
RLAPI void ShowWindow(); // Show the window
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 GetScreenHeight(void); // Get current screen height
RLAPI void *GetWindowHandle(void); // Get native window handle

Loading…
Cancel
Save