updates with change suggestions#1
Conversation
| if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_UNDECORATED)) FLAG_SET(flags, RGFW_windowNoBorder); | ||
| if (!FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_RESIZABLE)) FLAG_SET(flags, RGFW_windowNoResize); | ||
| if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_TRANSPARENT)) FLAG_SET(flags, RGFW_windowTransparent); | ||
| if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_HIDDEN)) FLAG_SET(flags, RGFW_windowHide); | ||
| if (FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_MAXIMIZED)) FLAG_SET(flags, RGFW_windowMaximize); | ||
| if (!FLAG_IS_SET(CORE.Window.flags, FLAG_WINDOW_UNFOCUSED)) FLAG_SET(flags, RGFW_windowFocusOnShow | RGFW_windowFocus); |
There was a problem hiding this comment.
the git diff makes this look odd, but i basically just re-organized it like so:
- single-line flag settings
- multi-line flag settings
- opengl hints (technically multi-line flag but with other calls)
| { | ||
| FLAG_SET(CORE.Window.flags, FLAG_FULLSCREEN_MODE); | ||
| } |
There was a problem hiding this comment.
made this multi-line like the other fullscreen stuff just below it
| int result = RGFW_init(); | ||
| if (result != 0) | ||
| { | ||
| TRACELOG(LOG_WARNING, "RGFW: Failed to initialize RGFW"); | ||
| return -1; | ||
| } |
There was a problem hiding this comment.
i moved this in here because it seemed like it should probably init for any fullscreen, not just 0/0 size. and all the fullscreen stuff can be together
| CORE.Window.previousPosition.x = (CORE.Window.display.width - CORE.Window.previousScreen.width)/2; | ||
| CORE.Window.previousPosition.y = (CORE.Window.display.height - CORE.Window.previousScreen.height)/2; |
There was a problem hiding this comment.
i dont really like the doubled /2, it seems simpler to only divide once. and to use the previous variable values instead of double magick numbers
| } | ||
|
|
||
| RGFW_setGlobalHints_OpenGL(hints); | ||
|
|
There was a problem hiding this comment.
i put a space here to make a little bit of a logical separation between setting the previous flag and then the window creation
| int result = RGFW_init(); | ||
| if (result != 0) { TRACELOG(LOG_WARNING, "RGFW: Failed to initialize RGFW"); return -1; } |
There was a problem hiding this comment.
we don't need to do this every time and to follow the original pattern (made by riley) i think its better to only move it into the fullscreen section
There was a problem hiding this comment.
makes sense since fullscreen is the only code path that needs it, I was thinking "oh what if we start needing it in other code paths aswell", but no such paths exist
so if there were two or more, I would absolutely move it to the top, but like this it's fine
| CORE.Window.previousScreen.width = 800; | ||
| CORE.Window.previousScreen.height = 450; |
There was a problem hiding this comment.
tbh i think a better approach would be to use the full window size. so exiting fullscreen would still be fullscreen but "borderless window" style instead of "exclusive fullscreen" style.
BUT:
GLFW does these exact values and i dont have any objections i guess. the dev will probably handle the resolution change, anyways, so its not a big deal
|
seems reasonable |
ill leave notes on a per-line basis for my suggestions