34 Commits

Author SHA1 Message Date
Christian Haas
3d9aafed3b
[rcore_desktop] Fix 3693 initial window geometry (#3950)
* Rework window placement and dimensions for multi-monitor setups;

- fullscreen apps use primary monitor, exclusively
- non-fullscreen apps come in two variants:
a) pre-determined window size by user
b) use-active-monitor dimensions by user specifying 0x0
Either way, the window shall be centred at the monitor where it was created

This may have been the original intent, yet the primary monitor was used also for the second case, regardless where the window opened.

* Clean up code, handle error, fix integer-overflow for centering windowed fullscreen
2024-05-05 20:22:58 +02:00
Ray
3caa424ad4 Review formatting 2024-04-21 12:29:09 +02:00
Rafael Bordoni
88f7762921
Fix window not initializing on primary monitor on GLFW backend (#3923)
The way the current code worked was by calling `GetCurrentMonitor()`,
which would always return the monitor at position (0,0). This isn't the
primary monitor on all platforms, on Linux in particular it isn't the
case.

This isn't the case on the SDL backend, after calling `InitWindow()` the
window would always show up on the primary monitor. Even on the GLFW
backend, if the full screen flag was set it would attempt to put it on
the primary monitor as it would call `glfwGetPrimaryMonitor()` to do it,
so for consistency's sake we should do it on windowed mode too.
2024-04-19 15:17:22 +02:00
Ray
04afba260f REVIEWED: Window positioning, avoid out-of-screen window-bar 2024-04-08 11:27:56 +02:00
Ray
646d70e93a Remove trailing spaces 2024-04-02 09:38:06 +02:00
Ray
28c232d856 Update rcore_desktop.c 2024-03-18 09:13:34 +01:00
Jeffery Myers
9bb3d9977a
Put GLFW in relative mouse mode when the cursor is disabled. (#3874) 2024-03-18 09:12:36 +01:00
Alexandre Almeida
dc1cec8bab
Remove GLFW mouse passthrough hack and increase GLFW version in CMake (#3852) 2024-03-01 08:34:53 +01:00
Alexandre Almeida
6589311a0b
Update GLFW to 3.4 (#3827)
* Update GLFW to 3.4 (draft)

* Add _glfwConnectNull() function to rglfw.c

* Update rglfw.c

* Update Makefile

* Makefile: Replace USE_WAYLAND_DISPLAY with DISABLE_WAYLAND

* Revert "Makefile: Replace USE_WAYLAND_DISPLAY with DISABLE_WAYLAND"

This reverts commit 9e79abde786bf797d8133fd95e8a475cf6e2b066.

* GlfwImport.cmake: Replace GLFW_USE_WAYLAND with GLFW_BUILD_WAYLAND

* Update rglfw.c

* Output platform selected by GLFW to TRACELOG

* GLFW has removed Mir support
2024-02-29 18:29:32 +01:00
GideonSerf
371d25c8c9
Gamepad rumble support with SDL2 (#3819)
* Added gamepad rumble to rcore_desktop.c and rcore_desktop_sdl.c
Still need to add to the rest of the platforms.

* Add SetGamepadVibration warnings to unimplemented platforms.

* Added MAX_GAMEPAD_VIBRATION_TIME
The rumble in SDL2 will continue for MAX_GAMEPAD_VIBRATION_TIME unless the user cancels it with a call to SetGamepadVibration(0.0f,0.0f,0.0f)

* Cast float duration value to Uint 32

* Changed defines from int to float and fixed typo

---------

Co-authored-by: Gideon Serfontein <gse@newspacesystems.com>
2024-02-24 16:47:27 +01:00
Karl Zylinski
520c8cffb2
Simplified GetWindowScaleDPI() so it does not fetch the wrong DPI scale some times (Windows looks at center of window while the old raylib code looked on upper left corner of window, now it just uses the glfw function to fetch the window's current scaling). Also introduced a callback to update the CORE.Window.screenScaling when the content scaling updates, previously scaling did not work correctly on systems with multiple monitors that have different DPI scaling. (#3701) 2024-01-13 10:49:04 +01:00
Ray
3f1e59a7cf Update copyright to 2024 2024-01-02 20:58:12 +01:00
Ray
efe3510a9a REVIEWED: SDL text input to Unicode codepoints #3650
REVIEWED: GLFW naming conventions to reflect codepoints reading
2023-12-23 12:04:19 +01:00
Kenneth M
8b33d1eeb9
Fix IsMouseButtonUp() (#3609) 2023-12-07 19:50:36 +01:00
Ray
5aa84a34ea Revert "Fix warning while using external GLFW older than version 3.4.0 (#3599)"
This reverts commit f1b0d15813098228369dd647ffc04a7dbd92c02a.
2023-12-03 20:06:34 +01:00
Marco Maia
f1b0d15813
Fix warning while using external GLFW older than version 3.4.0 (#3599)
Co-authored-by: Marco Maia <marco.maia@iarasystems.com.br>
2023-12-03 19:53:52 +01:00
RadsammyT
fe53ba80dd
Fix typos in src/platforms/rcore_*.c (#3581) 2023-11-28 20:39:10 +01:00
Ray
107ece438a Reviewed duplicate lines 2023-11-10 19:48:47 +01:00
Ray
e4ea116857 Reviewing automation events on web... 2023-11-10 19:25:28 +01:00
Ray
b40f93b9e3 Comments tweaks 2023-11-02 18:12:22 +01:00
Ray
de7beef05d Remove trailing spaces 2023-10-31 15:54:52 +01:00
Ray
0a3567439d Comments tweaks 2023-10-31 15:49:42 +01:00
Ray
b4865588f8 REVIEWED: GetCurrentMonitor() #3472 2023-10-29 16:36:46 +01:00
Alexandre Almeida
2db7c727b6
GetCurrentMonitor() - use closest monitor (#3472) 2023-10-27 17:01:05 +02:00
Alexandre Almeida
2f6b2897fe
GetCurrentMonitor() - check window center instead of top-left corner (#3468) 2023-10-26 10:18:00 +02:00
ubkp
cb1c2ffda1
Fix gamepad names for PLATFORM_DESKTOP/GLFW (#3462) 2023-10-25 19:13:51 +02:00
Ray
7e5eff8a29 Revert "Fix #3461"
This reverts commit 8fbd42d592c22612e18d2c6f9bcef8a107984675.
2023-10-25 10:15:19 +02:00
Ray
8fbd42d592 Fix #3461 2023-10-25 10:14:17 +02:00
Ray
a0f0034352 REVIEWED: InitPlatform() organization and code-gardening 2023-10-23 19:15:40 +02:00
Ray
3ff6026917 REVIEWED: Move screen capture logic to rcore.c, available for all platforms 2023-10-23 18:32:24 +02:00
Ray
bcfa7c6718 Update rcore_desktop.c 2023-10-22 10:08:39 +02:00
Ray
081fffd46e REVIEWED: Issue with functions definitions 2023-10-19 13:57:31 +02:00
Ray
b674e344a8 REVIEWED: Issue with symbols exposure 2023-10-19 13:46:02 +02:00
Ray
982641228c REDESIGNED: Move platforms to separate directory #3313 2023-10-19 13:36:10 +02:00