[rcore] Support window flags with initialization issues#4837
Conversation
This may not be the correct approach, however this appears to work. The idea is that before modifying `CORE.Window.flags` when first creating the window we keep a copy of the flags in order to call `SetWindowState` after initialization has completed, which should behave as if `MaximizeWindow` or `MinimizeWindow`, or conceptually any other flag modifying function were called after `InitWindow`. This pull request only performs this for the windows platform, modify as needed in the switch statement at the end for others.
|
I think you can do this for all the GLFW platforms, not just windows. |
|
@Andersama Sorry, I don't understand the use case of this change... user should know the flags they are modyfying... |
The use case is this. this does not maximize the window, because InitWindow strips those flags you must do
The idea was to have the internal platform call SetWindowState() after the window is initialized by the platform so that it can apply any of the flags that the window initialization can't or doesn't support. That way when you set these flags at config time, they are actually applied and not ignored silently. |
|
@raysan5 @JeffM2501's summary pretty much covers it. The only thought I had about doing this was that since this is mostly do to with opening a window, the code could be move to the calling function instead*, which I think would make more sense. But I think its inside this call that most of the work for opening a window is happening anyway so that's where I made the modification. Also, I wasn't sure if there were other reasons why these flags were ignored in this way. @JeffM2501 unfortunately I don't have a setup where I can test other operating systems. So I limited the change to the platform I'm confident works. |
|
@JeffM2501 @Andersama thanks for the explanation, I see the use case. |
This may not be the correct approach, however this appears to work. The idea is that before modifying
CORE.Window.flagswhen first creating the window we keep a copy of the flags in order to callSetWindowStateafter initialization has completed, which should behave as ifMaximizeWindoworMinimizeWindow, or conceptually any other flag modifying function were called afterInitWindow.This pull request only performs this for the windows platform, modify as needed in the switch statement at the end for others.