Commit graph

7,492 commits

Author SHA1 Message Date
SuperUserNameMan
0882f153d4
raylib.h : add flags to control the texture font linear filtering - part 1
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`.
2024-07-23 17:55:57 +02:00
SuperUserNameMan
02666be096
rcore.c : typo and cancel premature change merge 2024-07-23 17:20:56 +02:00
SuperUserNameMan
df62c800fa
rcore_desktop_glfw.c : fix HDPI scaling on Win11 + window restoration on Wayland
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.
2024-07-23 14:24:52 +02:00
SuperUserNameMan
f3d8fc75e9
rcore_desktop_glfw.c : mouse offset and scaling consistency - part 2
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`.
2024-07-23 11:06:45 +02:00
SuperUserNameMan
02ae6e9365
rcore.c : mouse offset and scaling consistency - part 1
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`.
2024-07-23 11:05:27 +02:00
SuperUserNameMan
79316b2da9
typos 2024-07-22 18:14:24 +02:00
SuperUserNameMan
2ffca57629
GetWindowScaleDPI() return {1,1} if HDPI or fullscreen modes 2024-07-22 17:45:08 +02:00
SuperUserNameMan
19020153ca
rcore_desktop_glfw.c : disable FLAG_WINDOW_HIGHDPI on Wayland
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.
2024-07-22 17:09:42 +02:00
SuperUserNameMan
1a7657ebd0
rcore_desktop_glfw.c : SetWindowMonitor() workaround for Wayland
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).
2024-07-22 16:06:32 +02:00
SuperUserNameMan
c5f90a5edd
rcore_desktop_glfw.c : improved Wayland support 2024-07-22 15:35:26 +02:00
SuperUserNameMan
9fb406ac1a
rcore_desktop_glfw.c - Wayland compatibility
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.
2024-07-21 16:01:58 +02:00
SuperUserNameMan
310e4d72a8
rcore.c - add CORE.Window.lastAssociatedMonitorIndex for Wayland 2024-07-21 15:53:55 +02:00
SuperUserNameMan
04138459f0
invalid window size default to 3/4 of the display 2024-07-21 09:54:27 +02:00
SuperUserNameMan
b2c9c5ef88
make SetWindowMonitor() works with FLAG_BORDERLESS_WINDOWED 2024-07-20 15:48:40 +02:00
SuperUserNameMan
05b172008f
GLFW : Wayland don't support setting or getting window pos
Using `glfwGetWindowPos()` or `glfwSetWindowPos()` trigger errors that should be cleared with `glGetError(NULL)` to avoid misinterpretation of later use of `glGetError()`
2024-07-20 15:23:54 +02:00
SuperUserNameMan
a2ccd820e5
CodeQL bot : Variable result hides another variable of the same name (on ). 2024-07-17 18:47:50 +02:00
SuperUserNameMan
2d225145d7
Merge branch 'raysan5:master' into fix-ToggleBorderlessWindowed 2024-07-17 18:24:00 +02:00
SuperUserNameMan
a2d1e66ec4
Update rcore_desktop_glfw.c : replace old PR with new branch PR 2024-07-17 18:10:15 +02:00
SuperUserNameMan
3c48b5c6a8
Update raylib.h : add experimental FLAG_RESCALE_CONTENT 2024-07-17 18:09:22 +02:00
Lázaro Albuquerque
24726a4bc2
Removes the redundant USE_AUDIO flag (#4158) 2024-07-16 14:16:41 +02:00
red thing
0c03cbff90
Update BINDINGS.md: dray binding supports raylib 5.0 (#4163) 2024-07-16 14:00:30 +02:00
MrScautHD
576bee5cce
Adding GetKeyName(int key) (WIP) (#4161) 2024-07-16 14:00:00 +02:00
SuperUserNameMan
dc4c60bf62
detect Wayland special case at runtime 2024-07-15 18:42:45 +02:00
SuperUserNameMan
312f9c2cb7
disable GLFW_AUTO_ICONIFY for all fullscreen modes
If the user requires this feature, they can replicate the behavior on their code side using a simple : `if ( ! IsWindowFocused() ) MinimizeWindow();`
2024-07-15 14:49:02 +02:00
jkaup
5ede47618b
Fix crash when switching playback device (#4102)
Co-authored-by: jj <noname@nomail.fi>
2024-07-13 23:10:28 +02:00
SuperUserNameMan
32e9d882d7
InitPlatform() set GLFW_SCALE_FRAMEBUFFER to false by default 2024-07-13 10:45:16 +02:00
SuperUserNameMan
1b800a14eb
explicit focus request in ToggleFullscreen()
fix issue mentioned by @paulmelis ?
2024-07-12 13:09:38 +02:00
Kai Kitagawa-Jones
8d5374a443
Replace glGetInteger64v with glGetBufferParameteri64v (#4154) 2024-07-11 21:31:13 +02:00
SuperUserNameMan
b004531efb
immediate access to GetScreenWidth/Height(), GetRenderWidth/Height()
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.
2024-07-11 19:02:47 +02:00
SuperUserNameMan
545665da87
toggle currently active fullscreen mode and leave
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.
2024-07-11 18:36:56 +02:00
SuperUserNameMan
a76adf9a48
little ToggleFullscreen() cleanup 2024-07-11 18:14:12 +02:00
SuperUserNameMan
21bff481ff
comment clarification 2024-07-11 17:53:08 +02:00
InventorXtreme
44c6cd2d37
[build.zig] GLFW Platform Detection Support (#4150)
* 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
2024-07-11 09:59:26 +02:00
SuperUserNameMan
7ddb880f02
should fix all issues related to HDPI, fullscreen and bordeless
Work perfect on Linux wirth X11
Needs confirmation on Linux Wayland, MacOS, and Windows.
2024-07-10 17:13:17 +02:00
SuperUserNameMan
3f605e3143
some code style convention and we should be good 2024-07-10 12:02:40 +02:00
SuperUserNameMan
949aa21a7a
should fix ToggleBorderlessWindowed() on Linux and Macos
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
2024-07-10 11:48:09 +02:00
Jeffery Myers
74680748b9
[Shapes] Remove duplicate color calls in DrawGrid (#4148)
* 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>
2024-07-09 19:45:07 +02:00
SuperUserNameMan
174313acbf
WindowSizeCallback() should not try to handle DPI since already managed by GLFW (#4143)
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.
2024-07-09 09:23:14 +02:00
Ray
fa03246d0e REVIEWED: Code formatting to follow raylib conventions 2024-07-09 09:21:57 +02:00
Colleague Riley
98662b6a4a
update RGFW to RGFW 1.0 (#4144)
* update RGFW

* fix bug with GetCurrentMonitor
2024-07-09 09:12:03 +02:00
Ray
3abe728712 Minor tweaks 2024-07-08 22:54:19 +02:00
NishiOwO
598b7f5210
Add workaround for NetBSD (#4139) 2024-07-08 22:47:35 +02:00
Ray
9764fef262 Update models_billboard.c 2024-07-07 21:02:35 +02:00
Ray
43fe992b94 Merge branch 'master' of https://github.com/raysan5/raylib 2024-07-07 21:02:29 +02:00
Ray
b8e5179431 Update rmodels.c 2024-07-07 21:02:20 +02:00
github-actions[bot]
bc6cf61794 Update raylib_api.* by CI 2024-07-07 18:57:40 +00:00
Ray
df4ff4e78b REVIEWED: Direction must be normalized #4131 2024-07-07 20:57:18 +02:00
bohonghuang
6dd2a0e645
[rmodels] Consistent DrawBillboardPro with DrawTexturePro (#4132)
* [rmodels] Re-implement `DrawBillboardPro`

* [rmodels] Add comments to `DrawBillboardPro`

* [rmodels] Make `DrawBillboardPro` consistent with `DrawTexturePro`

* Update raylib_api.* by CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-07 20:27:51 +02:00
Ninad Sachania
b61303244c
Fix Reddit badge (#4136) 2024-07-07 10:47:44 +02:00
Ray
a8240722c6 REVIEWED: CheckCollisionPointRec() 2024-07-07 09:09:34 +02:00