mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-06 06:13:10 +00:00
REVIEWED: Flags set/clear #5169
This commit is contained in:
parent
5fbf67a630
commit
3cf3b309c6
@ -1854,15 +1854,15 @@ static void WindowIconifyCallback(GLFWwindow *window, int iconified)
|
||||
// GLFW3 WindowMaximize Callback, runs when window is maximized/restored
|
||||
static void WindowMaximizeCallback(GLFWwindow *window, int maximized)
|
||||
{
|
||||
if (maximized) FLAG_SET(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // The window was maximized
|
||||
else FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // The window was restored
|
||||
if (maximized) FLAG_SET(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // The window was maximized
|
||||
else FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED); // The window was restored
|
||||
}
|
||||
|
||||
// GLFW3 WindowFocus Callback, runs when window get/lose focus
|
||||
static void WindowFocusCallback(GLFWwindow *window, int focused)
|
||||
{
|
||||
if (focused) FLAG_SET(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // The window was maximized
|
||||
else FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // The window was restored
|
||||
if (focused) FLAG_SET(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // The window was focused
|
||||
else FLAG_CLEAR(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED); // The window lost focus
|
||||
}
|
||||
|
||||
// GLFW3 Window Drop Callback, runs when drop files into window
|
||||
|
||||
@ -423,6 +423,10 @@ void SetWindowState(unsigned int flags)
|
||||
{
|
||||
RGFW_window_setFloating(platform.window, RGFW_TRUE);
|
||||
}
|
||||
if (FLAG_IS_SET(flags, FLAG_WINDOW_ALWAYS_RUN))
|
||||
{
|
||||
FLAG_SET(CORE.Window.flags, FLAG_WINDOW_ALWAYS_RUN);
|
||||
}
|
||||
if (FLAG_IS_SET(flags, FLAG_WINDOW_TRANSPARENT))
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "WINDOW: Framebuffer transparency can only be configured before window initialization");
|
||||
|
||||
@ -588,6 +588,10 @@ void SetWindowState(unsigned int flags)
|
||||
{
|
||||
SDL_SetWindowAlwaysOnTop(platform.window, SDL_FALSE);
|
||||
}
|
||||
if (FLAG_IS_SET(flags, FLAG_WINDOW_ALWAYS_RUN)
|
||||
{
|
||||
FLAG_SET(CORE.Window.flags, FLAG_WINDOW_ALWAYS_RUN);
|
||||
}
|
||||
if (FLAG_IS_SET(flags, FLAG_WINDOW_TRANSPARENT))
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "SetWindowState() - FLAG_WINDOW_TRANSPARENT is not supported on PLATFORM_DESKTOP_SDL");
|
||||
@ -1933,7 +1937,7 @@ int InitPlatform(void)
|
||||
FLAG_SET(flags, SDL_WINDOW_FULLSCREEN);
|
||||
}
|
||||
|
||||
//if (!FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIDDEN)) FLAG_SET(flags, SDL_WINDOW_HIDDEN);
|
||||
//if (!FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIDDEN)) FLAG_SET(flags, SDL_WINDOW_HIDDEN);
|
||||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_UNDECORATED)) FLAG_SET(flags, SDL_WINDOW_BORDERLESS);
|
||||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_RESIZABLE)) FLAG_SET(flags, SDL_WINDOW_RESIZABLE);
|
||||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MINIMIZED)) FLAG_SET(flags, SDL_WINDOW_MINIMIZED);
|
||||
@ -1943,9 +1947,9 @@ int InitPlatform(void)
|
||||
FLAG_CLEAR(flags, SDL_WINDOW_INPUT_FOCUS);
|
||||
FLAG_CLEAR(flags, SDL_WINDOW_MOUSE_FOCUS);
|
||||
}
|
||||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_TOPMOST)) FLAG_SET(flags, SDL_WINDOW_ALWAYS_ON_TOP);
|
||||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_TOPMOST)) FLAG_SET(flags, SDL_WINDOW_ALWAYS_ON_TOP);
|
||||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MOUSE_PASSTHROUGH)) FLAG_CLEAR(flags, SDL_WINDOW_MOUSE_CAPTURE);
|
||||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) FLAG_SET(flags, SDL_WINDOW_ALLOW_HIGHDPI);
|
||||
if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIGHDPI)) FLAG_SET(flags, SDL_WINDOW_ALLOW_HIGHDPI);
|
||||
|
||||
//if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_TRANSPARENT)) FLAG_SET(flags, SDL_WINDOW_TRANSPARENT); // Alternative: SDL_GL_ALPHA_SIZE = 8
|
||||
//if (FLAG_IS_SET(CORE.Window.flags, FLAG_FULLSCREEN_DESKTOP)) FLAG_SET(flags, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
|
||||
@ -271,7 +271,7 @@ static DWORD MakeWindowStyle(unsigned flags)
|
||||
|
||||
// Minimized takes precedence over maximized
|
||||
int mized = MIZED_NONE;
|
||||
if (FLAG_CHECK(flags, FLAG_WINDOW_MINIMIZED)) mized = MIZED_MIN;
|
||||
if (FLAG_IS_SET(flags, FLAG_WINDOW_MINIMIZED)) mized = MIZED_MIN;
|
||||
if (flags & FLAG_WINDOW_MAXIMIZED) mized = MIZED_MAX;
|
||||
|
||||
switch (mized)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user