When in `FLAT_RESCALE_CONTENT` mode, the default "nearest pixel" filter of the texture font is ugly sometimes. So this change adds `FLAG_RESCALE_CONTENT_LINEAR` and `FLAG_TEXT_LINEAR_FILTER` to offer more control. `FLAG_TEXT_LINEAR_FILTER` can also be used to disable the linear filtering of `FLAG_WINDOW_HIGHDPI`.
When in `FLAT_RESCALE_CONTENT` mode, the default "nearest pixel" filter of the texture font is ugly sometimes. So this change adds `FLAG_RESCALE_CONTENT_LINEAR` and `FLAG_TEXT_LINEAR_FILTER` to offer more control. `FLAG_TEXT_LINEAR_FILTER` can also be used to disable the linear filtering of `FLAG_WINDOW_HIGHDPI`.
When in `FLAT_RESCALE_CONTENT` mode, the default "nearest pixel" filter of the texture font is ugly sometimes. So this change adds `FLAG_RESCALE_CONTENT_LINEAR` and `FLAG_TEXT_LINEAR_FILTER` to offer more control. `FLAG_TEXT_LINEAR_FILTER` can also be used to disable the linear filtering of `FLAG_WINDOW_HIGHDPI`.
As a general rule, Raylib API functions should not be used internally by the platform code, because these functions may be tuned for cross-platform consistency so they return consistent data relevant to the user perspective, and not to the platform code perspective.
---
I don't know if it is a GLFW bug, but on Wayland, the `WindowSizeCallback()` is not called when the window is restored from a fullscreen mode, and I had to workaround that.
As discovered by @SoloByte, using `glfwSetFramebufferSizeCallback()` instead of `glfwSetWindowSizeCallback()` solves this issue on Wayland, and deprecate the workaround.
I did not want to touch `rcore.c`, but it was required for cross-paltform consistency, so that `SetMouseScale()` and `SetMouseOffset()` have same effect on every platform, and don't interfere with mouse offset and scaling required and preset by a platform which should, instead, use the new `CORE.Input.Mouse.platformOffset` and `CORE.Input.Mouse.platformScale`.
I did not want to touch `rcore.c`, but it was required for cross-paltform consistency, so that `SetMouseScale()` and `SetMouseOffset()` have same effect on every platform, and don't interfere with mouse offset and scaling required and preset by a platform which should, instead, use the new `CORE.Input.Mouse.platformOffset` and `CORE.Input.Mouse.platformScale`.
If Ubuntu is not mistaking me, on Wayland `FLAG_WINDOW_HIHDPI` could just be ignored because the window decorator (or whatever subsystem in charge) already rescale the window and its content according to the display scale.
According to my understanding of current GLFW version, on Wayland, the only way to move the windowed window from one monitor to another is to toggle it to fullscreen twice (since only a fullscreen window can be moved to another monitor by code).
Because Wayland does not let know or set the position of a window, it broke some basic Raylib's features and functions. I tried to find a balance between crossplatform compatibilities, and the Wayland way of doing things. So, on Wayland, `SetWindowMonitor()` won't move a windowed window from a monitor to another, but can be used to select on which monitor the user wants the hardware fullscreen mode.
Using `glfwGetWindowPos()` or `glfwSetWindowPos()` trigger errors that should be cleared with `glGetError(NULL)` to avoid misinterpretation of later use of `glGetError()`
Call `WindowSizeCallback()` manually so we don't have to wait for after the next `EndDrawing()` to have access to up to date `GetScreenWidth()` etc value.
Trying to go straight forward from one fullscreen mode to another make things more complicated to control.
Seems a full loop is required when trying to change fullscreen modes and window size properly for now.
Maybe will restore the ability to jump from one fullscreen mode to another when more cleaning will be done deeper in the rabbit hole.
* Zig Both Linux Desktop Platform Support
* Formating and Default Fix
Made formating fit within raylib standards and changed the default option to support both X11 and wayland on Linux.
* caught one hiding tab
should fix issue #4149
Linux MATE : tested
Macos : tested
Windows : need confirmation
---
thanks to @SoloByte and to @paulmelis for their help and efforts to solve this issue
* Update raylib_api.* by CI
* No need to call the color 4 times in a row, it's batched
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
If `FLAG_WINDOW_HIGHDPI` is set, `InitPlatform()` will aks GLFW to handle resize window content area based on the monitor content scale using : ` glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); `
So `WindowSizeCallback()` does not have to handle it a second time.