[rcore][RGFW] Add fullscreen behaviour on size 0 window creation#5859
Conversation
|
@CrackedPixel Please, could you take a look to this PR? It surprises me that |
it usually automatically does it internally on createwindow for convenience |
|
I don't really like a lot of this PR but i will look at it today and compare to glfw and other platforms to see about a good solution |
updates with change suggestions
|
the changes seemed reasonable |
|
LGTM! nice work 😎 |
|
actually one thing to note is that the return value of RGFW_init is rather weird: from RGFW's source code:
but if you look at the internal code, when you call it but it is already initialized it returns 1 - which is kind of weird but technically still correct within the api where it gets truly weird is that it actually doesn't always return a negative number on error if (_RGFW->compositor == NULL) {
RGFW_sendDebugInfo(RGFW_typeError, RGFW_errWayland, "Can't find compositor.");
return 1;
}this means we can't just check < 0, unlike the comment implies for the purposes of raylib, breaking on multiple windows is technically not an issue, since that's not supported anyways, right? this might however still be an issue on so maybe it would be better to ignore the return value entirely? that's what rgfw does whenever calling it internally |
|
@keks137 thanks for the improvement and thanks @CrackedPixel for the review |
|
it seems we will be able to remove the RGFW_init call entirely in a future update of RGFW, the fact that we need it right now is a bug ColleagueRiley/RGFW#523 (comment) |
rcore_desktop_glfw has a nice feature of automatically creating a fullscreen window if you InitWindow(0,0,"title")
but on rgfw it instead just got stuck saying "failed to create drawable"
so I mostly just copied the logic, including the comments, from the glfw backend to handle this case
it does mean we now need to call RGFW_init ahead of time, to be able to get the primary monitor in the case of a size zero window