Commit Graph

102 Commits

Author SHA1 Message Date
Eric Wasylishen
76392f4fe1 Handle DPI scaling in SDL_GetWindowSurface
Fixes DPI awareness of testdrawchessboard (previously, the surface was
being created in points instead of pixels, resulting in the demo app
only drawing in a corner of the screen on High-DPI displays)

*_CreateWindowFramebuffer()/*_UpdateWindowFramebuffer(): are updated
to use SDL_GetWindowSizeInPixels instead of SDL_GetWindowSize() or
window->w/window->h.

Most of the _CreateWindowFramebuffer backends are untested except
for Windows.

Fixes #7047

(cherry picked from commit 67c91353e01f6f2c0cc80c17eeddbad6def7cb01)
2023-06-14 17:23:54 -07:00
Sam Lantinga
36033e3832 Make it clear that you can't mix 2D rendering and the window surface API
Also added functions to query and destroy the window surface so you can switch between modes if you want.

See https://github.com/pygame-community/pygame-ce/issues/2190 for more details.
2023-06-10 08:54:36 -07:00
Sam Lantinga
0479df53ca Updated copyright for 2023 2023-01-09 09:48:21 -08:00
Sam Lantinga
264da8c127 Added SDL_DISPLAYEVENT_MOVED to detect when display positioning changes 2022-12-08 12:46:13 -08:00
Sam Lantinga
1f87e9e24e Updated patch notes for 2.26 release 2022-11-17 09:00:27 -08:00
SDL Wiki Bot
393acf6362 Sync SDL wiki -> header 2022-10-25 18:07:13 +00:00
Pierre Wendling
f9785702a6 N3DS: Deduce screen from window's display.
This removes the need for a dedicated window creation flag.
2022-10-10 08:50:59 -07:00
Pierre Wendling
655275378d N3DS port (squashed)
A dedicated renderer using Citro3D would likely allow for better
much better graphical performances.
2022-10-10 08:50:59 -07:00
SDL Wiki Bot
9df1af352f Sync SDL wiki -> header 2022-10-09 15:44:07 +00:00
SDL Wiki Bot
4ca86dae2f Sync SDL wiki -> header 2022-10-05 23:26:14 +00:00
Noel Berry
00452e47fa
Adding SDL_GetWindowSizeInPixels for window size in pixels (#6112) 2022-08-24 11:25:13 -07:00
Ryan C. Gordon
07b0ec539f
SDL_video.h: Added \since info to new APIs. 2022-08-09 09:05:08 -04:00
Ryan C. Gordon
a35cff634b
Sync wiki -> headers.
(bridge got stuck, I'm just kicking it to get it working again, idk.)
2022-08-08 16:07:31 -04:00
Sam Lantinga
98bac00dcc Add SDL_GetPointDisplayIndex and SDL_GetRectDisplayIndex and re-implement SDL_GetWindowDisplayIndex in terms of SDL_GetRectDisplayIndex
- This allows looking up the display index for an arbitrary location rather than requiring an active window to do so.

- This change also reimplements the fallback display lookup that found the display with center closest to the window's center to instead find the display rect edge
  closest to the window center (this was done in the almost identical display lookup used in SDL_windowsmodes.c, which now uses `SDL_GetPointDisplayIndex`). In
  practice this should almost never be hit as it requires the window's center to not be enclosed by any display rect.
2022-08-08 11:26:52 -07:00
Shootfast
60d1944e46 SDL_video: Added SDL_GL_FLOATBUFFERS to allow Cocoa GL contexts to use EDR 2022-08-02 15:45:30 -07:00
SDL Wiki Bot
75f34fc5bf Sync SDL wiki -> header 2022-08-02 14:52:12 +00:00
Ryan C. Gordon
307b0b7813
video: Add a warning to the docs about using SDL_GetDisplayDPI.
Fixes #5647.
2022-08-02 10:51:31 -04:00
Frank Praznik
41b89aec19 video: Improve the SDL_WINDOW_ALLOW_HIGHDPI flag documentation
Extend the SDL_WINDOW_ALLOW_HIGHDPI flag documentation to stress the importance of querying the window drawable size after every window event to avoid rendering issues in a mixed-DPI environment.
2022-07-22 13:01:57 -04:00
Ryan C. Gordon
195ca499ca
include/SDL_video.h: You can google it.
This looks bad when reading Markdown as plain text, as one would do when
reading the headers directly.
2022-05-25 10:46:06 -04:00
Ryan C. Gordon
7ce311bead
include/SDL_system.h: Fixed a link that was still hg.libsdl.org 2022-05-25 10:43:14 -04:00
SDL Wiki Bot
a8e7548797 Sync wiki -> header 2022-05-24 22:57:04 +00:00
SDL Wiki Bot
179765561c Sync wiki -> header 2022-05-24 18:26:05 +00:00
SDL Wiki Bot
6d1c3cd691 Sync wiki -> header 2022-03-27 17:11:05 +00:00
Sam Lantinga
120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL Wiki Bot
3c71f8939b Sync wiki -> header 2021-11-25 13:53:04 +00:00
Cameron Gutman
57520cbde6 Improve documentation for input grabbing functions 2021-11-25 16:49:57 +03:00
Ryan C. Gordon
cb4491ca60
Sync wiki -> header 2021-11-10 16:05:03 -05:00
Ryan C. Gordon
b42ae3dbfe
Sync wiki -> header 2021-11-10 15:21:01 -05:00
Sam Lantinga
fd79607eb0 Added SDL_GetWindowMouseRect()
Also guarantee that we won't get mouse movement outside the confining area, even if the OS implementation allows it (e.g. macOS)
2021-11-08 21:34:48 -08:00
Ethan Lee
4b42c05ba1 video: Add SDL_SetWindowMouseRect.
This API and implementation comes from the Unreal Engine branch of SDL, which
originally called this "SDL_ConfineCursor".

Some minor cleanup and changes for consistency with the rest of SDL_video, but
there are two major changes:

1. The coordinate system has been changed so that `rect` is _window_ relative
   and not _screen_ relative, making it easier to implement without having
   global access to the display.
2. The UE version unset all rects when passing `NULL` as a parameter for
   `window`, this has been removed as it was an unused feature anyhow.

Currently this is only implemented for X, but can be supported on Wayland and
Windows at minimum too.
2021-11-08 14:16:54 -08:00
SDL Wiki Bot
c7dafb1556 Sync wiki -> header 2021-10-27 01:36:05 +00:00
SDL Wiki Bot
6c134cf148 Sync wiki -> header 2021-10-22 00:39:04 +00:00
Cacodemon345
19dee1cd16
Add SDL_GetWindowICCProfile(). (#4314)
* Add SDL_GetWindowICCProfile

* Add new SDL display events

* Implement ICC profile change event for macOS

* Implement ICC profile notification for Windows

* Fix SDL_GetWindowICCProfile() for X11

* Fix compile errors
2021-10-21 17:37:20 -07:00
Ryan C. Gordon
1b49f09243
include: manually ran wikiheaders.pl and cleaned up the obvious issues. 2021-10-08 20:50:30 -04:00
SDL Wiki Bot
ba9e2299b3 Sync wiki -> header 2021-09-18 14:19:04 +00:00
Cameron Cawley
2d44bf7dcf Update description of SDL_SetWindowAlwaysOnTop 2021-09-18 10:17:32 -04:00
SDL Wiki Bot
d856478f70 Sync wiki -> header 2021-09-17 19:12:05 +00:00
SDL Wiki Bot
74a1eb2106 Sync wiki -> header 2021-09-17 19:10:07 +00:00
YuGiOhJCJ
966728db2a include/SDL_video.h: Remove a comma at end of enumerator list 2021-08-17 10:00:28 +03:00
Sam Lantinga
14d58dc890 Fixed the parameter documentation 2021-07-27 14:23:40 -07:00
Sam Lantinga
f1633127d1 Added a window flash operation to be explicit about window flash behavior 2021-07-24 13:42:19 -07:00
Sam Lantinga
e1c3a25034 Changed SDL_FlashWindow() so it doesn't take a flash count, and added the hint SDL_HINT_WINDOW_FLASH_COUNT to control behavior on Windows 2021-07-24 12:11:27 -07:00
SDL Wiki Bot
7edffc5798 Sync wiki -> header 2021-07-23 18:29:04 +00:00
Ryan C. Gordon
37d4f003b7
doxygen: Removed some cruft that accumulated during wiki migration. 2021-07-14 17:09:05 -04:00
Ryan C. Gordon
c88eb7a896
Sync wiki -> header. 2021-07-14 17:07:04 -04:00
Ryan C. Gordon
f8c1fc49d9
doxygen: Fix all the "\returns" so they work as part of complete sentences. 2021-07-14 14:15:30 -04:00
Ryan C. Gordon
0ac13dc27f
doxygen: Tweak SDL_FlashWindow brief description.
So "e.g." doesn't look like the end of the sentence to wikiheaders.pl.
2021-07-14 11:02:59 -04:00
Jupeyy
64724db0a1 Implement bare minimum for SDL_FlashWindow 2021-06-04 15:07:55 -07:00
Ethan Lee
f309d0649d include: Document timing issue with SDL_GetWindowBordersSize 2021-05-04 13:16:13 -04:00
Ryan C. Gordon
c54c16d353
wayland: don't hang in SDL_GL_SwapBuffers if the compositor is ghosting us.
If you hide a window on Mutter, for example, the compositor never requests
new frames, which will cause Mesa to block forever in eglSwapBuffers to
satisfy the swap interval.

We now always set the swap interval to 0 and manage this ourselves, handing
the frame to Wayland when it requests a new one, and timing out at 10fps just
to keep apps moving if the compositor wants no frames at all.

My understanding is that other protocols are coming that might improve upon
this solution, but for now it solves the total hang.

Fixes #4335.
2021-04-30 13:20:35 -04:00