浏览代码

Merge pull request #4895 from AndrewHamel111/descriptive-window-flag-warning

Add Warning to direct users to appropriate WindowState / ConfigFlag function
pull/4903/head
Ray 3 天前
committed by GitHub
父节点
当前提交
73030e02d4
找不到此签名对应的密钥 GPG 密钥 ID: B5690EEEBB952194
共有 5 个文件被更改,包括 10 次插入0 次删除
  1. +2
    -0
      src/platforms/rcore_desktop_glfw.c
  2. +2
    -0
      src/platforms/rcore_desktop_rgfw.c
  3. +2
    -0
      src/platforms/rcore_desktop_sdl.c
  4. +2
    -0
      src/platforms/rcore_web.c
  5. +2
    -0
      src/rcore.c

+ 2
- 0
src/platforms/rcore_desktop_glfw.c 查看文件

@ -307,6 +307,8 @@ void RestoreWindow(void)
// Set window configuration state using flags
void SetWindowState(unsigned int flags)
{
if (!CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetWindowState does nothing before window initialization, Use \"SetConfigFlags\" instead");
// Check previous state and requested state to apply required changes
// NOTE: In most cases the functions already change the flags internally

+ 2
- 0
src/platforms/rcore_desktop_rgfw.c 查看文件

@ -350,6 +350,8 @@ void RestoreWindow(void)
// Set window configuration state using flags
void SetWindowState(unsigned int flags)
{
if (!CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetWindowState does nothing before window initialization, Use \"SetConfigFlags\" instead");
CORE.Window.flags |= flags;
if (flags & FLAG_VSYNC_HINT)

+ 2
- 0
src/platforms/rcore_desktop_sdl.c 查看文件

@ -518,6 +518,8 @@ void RestoreWindow(void)
// Set window configuration state using flags
void SetWindowState(unsigned int flags)
{
if (!CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetWindowState does nothing before window initialization, Use \"SetConfigFlags\" instead");
CORE.Window.flags |= flags;
if (flags & FLAG_VSYNC_HINT)

+ 2
- 0
src/platforms/rcore_web.c 查看文件

@ -364,6 +364,8 @@ void RestoreWindow(void)
// Set window configuration state using flags
void SetWindowState(unsigned int flags)
{
if (!CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetWindowState does nothing before window initialization, Use \"SetConfigFlags\" instead");
// Check previous state and requested state to apply required changes
// NOTE: In most cases the functions already change the flags internally

+ 2
- 0
src/rcore.c 查看文件

@ -1905,6 +1905,8 @@ void TakeScreenshot(const char *fileName)
// To configure window states after creation, just use SetWindowState()
void SetConfigFlags(unsigned int flags)
{
if (CORE.Window.ready) TRACELOG(LOG_WARNING, "WINDOW: SetConfigFlags called after window initialization, Use \"SetWindowState\" to set flags instead");
// Selected flags are set but not evaluated at this point,
// flag evaluation happens at InitWindow() or SetWindowState()
CORE.Window.flags |= flags;

正在加载...
取消
保存