Commit graph

200 commits

Author SHA1 Message Date
Sam Lantinga
f69485f745 Added SDL_GetDisplayOrientation() to get the display orientation, and added a new event SDL_DISPLAYEVENT to notify the application when the orientation changes.
Documented the values returned by the accelerometer and gyroscope sensors
2018-08-22 21:48:28 -07:00
Mark Callow
f410bef6cc Fix high-dpi support on macOS and simplify it and iOS variant.
The detault drawableSize for a CAMetalLayer is its bounds x its scale.
So it is sufficient to set the *layer's* scale to the desired value.
2018-02-21 09:58:21 -08:00
Sam Lantinga
346af016a5 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
a5b3e11d5c Fixed typos (thanks Martin!) 2017-12-04 20:21:52 -08:00
Sam Lantinga
24522941fe Updated documentation so it's clear you should use SDL_SetWindowDisplayMode() to change the size of fullscreen windows. 2017-09-09 11:04:35 -07:00
Ryan C. Gordon
6c60625436 vulkan: Changed SDL_WINDOW_VULKAN value to match Tizen's fork. 2017-09-03 13:20:33 -04:00
Ryan C. Gordon
a566435db1 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.

--HG--
extra : rebase_source : cb3bb332146125366b5242c0d7444f44638733d9
extra : amend_source : c72ebb6d3a92efc3fdd085ce3b6d4b1d7f573cc9
2017-08-27 22:15:57 -04:00
Ryan C. Gordon
b82bd0bd37 opengl: add support for GL_KHR_no_error.
This is completely untested!

Fixes Bugzilla #3721.
2017-08-24 21:30:53 -04:00
Ryan C. Gordon
4e99081584 opengl: Add support for [GLX|WGL]_ARB_create_context_robustness.
This patch was originally written by Marc Di Luzio for glX and enhanced by
Maximilian Malek for WGL, etc. Thanks to both of you!

Fixes Bugzilla #3643.
Fixes Bugzilla #3735.

--HG--
extra : rebase_source : 4339a25375897f157f59719876086f84acc10aad
2017-08-19 15:02:03 -04:00
Sam Lantinga
8d2f4c623e Fixed bug 3720 - SDL_GL_GetAttribute doesn't check for initialized video driver
Simon Hug

SDL_GL_GetAttribute doesn't check if a video driver has been initialized and will access the SDL_VideoDevice pointer, which is NULL at that point.

I think all of the attributes require an initialized driver, so a simple NULL check should fix it. Patch is attached.
2017-07-31 12:57:15 -07:00
Philipp Wiesemann
3e556aa92e Fixed comments in headers for doxygen output. 2017-06-04 23:15:39 +02:00
Sam Lantinga
c56254daa7 SDL - add SDL_WINDOW_VULKAN and make Android_CreateWindow only create an EGLSurface when SDL_WINDOW_VULKAN is not present. This makes it so the ANativeWindow* can be used with vkCreateAndroidSurfaceKHR, otherwise it will fail because having both an EGLSurface and VkSurfaceKHR attached to a window is not allowed according to the Vulkan spec:
"In particular, only one VkSurfaceKHR can exist at a time for a given window. Similarly, a native window cannot be used by both a VkSurfaceKHR and EGLSurface simultaneously"

CR: SamL
2017-05-16 06:30:39 -07:00
Sam Lantinga
1b24bfad38 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
192fc4cdb5 Fixed ABI, don't change the return type of SDL_GL_SwapWindow() 2016-12-11 12:01:44 -08:00
Sam Lantinga
d77e4ac317 Fixed bug 3513 - SDL_GL_SwapWindow does not return error status
Return an error code from SDL_GL_SwapWindow(), like the other SDL APIs.
2016-12-09 01:47:43 -08:00
Sam Lantinga
91e0a1d094 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Sam Lantinga
2803a1f6b3 Fixed bug 3165 - define numbers don't match types in Swift
C.W. Betts

Swift is very strict with types, so much that those of different signedness/size must be cast. Most of the defines are imported as 32-bit signed integers, while the corresponding field in a struct is a 32-bit unsigned integer. Appending a "u" would cause the defined types to be imported as 32-bit unsigned integers.
2016-10-01 13:35:36 -07:00
Ryan C. Gordon
68abf12b7b Added SDL_SetWindowResizable(). (thanks, Ethan!)
--HG--
extra : rebase_source : a1929f1de6844265f3744a87384620703f960de9
2016-09-29 22:52:41 -04:00
Philipp Wiesemann
7276d8862d Added link in header comment. 2016-08-17 21:05:00 +02:00
Philipp Wiesemann
e0a678cddf Fixed two old identifiers in header comments. 2016-08-03 22:39:44 +02:00
Philipp Wiesemann
174644080b Updated documentation of SDL_IsScreenSaverEnabled().
The screensaver is deactivated by default since SDL 2.0.2.
2016-05-20 22:18:15 +02:00
Philipp Wiesemann
a34752c0b2 Updated documentation of SDL_CreateWindow() and SDL_CreateWindowFrom(). 2016-05-11 21:09:45 +02:00
Philipp Wiesemann
ec0694a978 Fixed doxygen warnings. 2016-01-06 22:38:35 +01:00
Ryan C. Gordon
3230d74d35 Added SDL_WINDOWEVENT_TAKE_FOCUS.
This is for corner cases where a multi-window app is activated and wants to
make a decision about where focus should go.

This patch came from Unreal Engine 4's fork of SDL, compliments of Epic Games.

--HG--
extra : histedit_source : 6fd97aa1e055c3b27127ea1ca2fc2a2022f2a65f
2016-01-05 02:27:50 -05:00
Ryan C. Gordon
8c55bb48fe Added SDL_WINDOWEVENT_HIT_TEST.
This lets windows know when they are dropping a mouse event because their
hit test reported something other than SDL_HITTEST_NORMAL. It lets them know
exactly where in the event queue this happened.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : histedit_source : 28a87f5e035dcf9b84e2a343c36e55795e2d4dcc
2015-04-21 10:10:59 -04:00
Ryan C. Gordon
cdd64f2020 Added SDL_SetWindowModalFor().
This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : amend_source : 645293aaac39f2f9740ead48719b5d285a53ba2c
extra : histedit_source : ab4c8f32ee931de00f9f632dd34d860f65279922
2015-04-21 09:45:58 -04:00
Ryan C. Gordon
19373e60da Added SDL_SetWindowInputFocus().
This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : amend_source : 730a99950b9cece544b7bebc4e5ae89a76ece0c8
extra : histedit_source : 2ade56ac0691a527638010cf47ed23467e38d21b
2016-01-05 02:28:56 -05:00
Ryan C. Gordon
2875d70eba Added SDL_SetWindowOpacity() and SDL_GetWindowOpacity().
This is currently implemented for X11, Cocoa, Windows, and DirectFB.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : amend_source : 99ddce333d2a4de7d59adb88d5059b34d731d907
extra : histedit_source : 012e8cb2f7822cd55cbbc124f642ccc530e3f75b%2Cbddf95ecf18ca97e1e3d7840971ef14ca739c9da
2016-01-05 02:46:10 -05:00
Ryan C. Gordon
8afe3ca698 Added SDL_GetWindowBordersSize().
This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : amend_source : dfbcf454974baeb9dea6aeee929dcecb14924e7c
extra : histedit_source : 9d688d7641ae624a1d0129796a338f4ff2b50896
2016-01-05 02:29:06 -05:00
Ryan C. Gordon
7344ea2528 Added special window type flags.
Specifically: always on top, skip taskbar, tooltip, utility, and popup menu.

This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.

--HG--
extra : histedit_source : e9036b7eb9238337f3d98b9c610ff3e1ed027a70
2016-01-05 01:30:40 -05:00
Ryan C. Gordon
6a3cfbf68f Added SDL_GetDisplayUsableBounds().
--HG--
extra : histedit_source : 3c9c2d344e3e3ff20bd86035066b65810346ac3e
2016-01-04 23:52:40 -05:00
Ryan C. Gordon
42fe73367b Added a few FIXMEs.
--HG--
extra : histedit_source : 53a67a6787730f05bb1e357680274e2473621629
2015-04-21 09:46:48 -04:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann
410efa90a8 Added brackets to function names in header comments so doxygen links them. 2016-01-01 17:39:55 +01:00
Alex Szpakowski
1c47d39ad1 Updated some header comments and iOS documentation to better clarify high-dpi / retina support and screen-coordinate sizes versus pixel sizes. 2015-12-31 21:16:43 -04:00
Alfred Reynolds
e26124316e Add SDL_GetDisplayDPI routine and implement for Windows. 2015-07-29 17:18:56 -07:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Ryan C. Gordon
d6ffb03a60 Minor input grab clarifications.
Clarify that grabbing the mouse only works with one window at a time; this was
always true at the system level, though SDL could previously get confused
by multiple simultaneous grabs, so now we explicitly break any existing
grab before starting a new one and document it as such.

Also track the window that is currently grabbed, and provide an API to query
for that window. This makes it easy to automate mouse ungrabbing at
breakpoints with gdb7's scripting, since the scripts can now know which window
to ungrab.

In 2.1, we should probably change this API to SDL_GrabInput(win) and
SDL_UngrabInput(void), or something.

--HG--
extra : rebase_source : c99570ccdaeb40c13fb0b00236fc77669705a189
extra : amend_source : 40993aa08816ef218bc10aa5d3a2aaa84f284240
2015-03-28 00:48:03 -04:00
Marc Di Luzio
ec0e5f1a73 Allow setting of GL_CONTEXT_RELEASE_BEHAVIOR when creating the GL context when GLX_ARB_context_flush_control is available.
This extension allows the user to specify whether a full flush is performed when making a context not current.
The only way to set this currently is at context creation, so this patch provides that functionality.
Defualt behaviour is set at FLUSH, as per the spec.

This patch does not contain the changes to WGL, appleGL or other platforms as I do not have access to GL 4.5 hardware on those platforms.

Full details on the use of KHR_context_flush_control can be found here:
https://www.opengl.org/registry/specs/KHR/context_flush_control.txt
2015-03-06 16:03:40 +00:00
Ionut Leonte
3465f8e461 Added SDL_HITTEST_RESIZE_*, and implemented for X11. 2014-06-05 00:45:16 -04:00
Ryan C. Gordon
c6b34e9e1e Tweaked hit-testing documentation.
--HG--
extra : rebase_source : df2f9ccdddf408e5aaf7e788a1983ce8fef13d46
2014-05-29 13:38:39 -04:00
Ryan C. Gordon
9e98d09104 Changed drag area API to a hit-testing API.
There were several good arguments for this: it's how Windows works with
 WM_NCHITTEST, SDL doesn't need to manage a list of rects, it allows more
 control over the regions (how do you use rects to cleanly surround a circular
 button?), the callback can be more optimized than a iterating a list of
 rects, and you don't have to send an updated list of rects whenever the
 window resizes or layout changes.

--HG--
rename : test/testdragareas.c => test/testhittesting.c
2014-05-28 01:22:47 -04:00
Ryan C. Gordon
cce4ce44d4 First shot at SDL_SetWindowDragAreas().
Only Cocoa implemented right now.

--HG--
extra : amend_source : b178ad0ae25b933b284ed1bda89df750ddd27fb3
2014-05-27 01:27:42 -04:00
Ryan C. Gordon
67f246e568 Implemented SDL_CaptureMouse(). 2014-05-24 01:30:37 -04:00
Philipp Wiesemann
8cc5275bde Fixed typo in header comment. 2014-05-18 21:05:39 +02:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Jørgen P. Tjernø
d17c440442 Add SDL_GL_ResetAttributes.
--HG--
extra : rebase_source : 0a6fd1c977ab93ba651adaae3fa5a71d7c69fa8e
2014-01-29 18:38:13 -08:00
Ryan C. Gordon
7a0350ba09 Added SDL_GL_FRAMEBUFFER_SRGB_CAPABLE (thanks, David!).
Fixes Bugzilla #1985.
2013-10-20 21:18:05 -04:00
Sam Lantinga
0a805ff137 Fixed bug 2119 - compiler warnings (-pedantic) SDL_video.h:111:42 2013-09-30 21:57:03 -07:00
Philipp Wiesemann
e0b5831e14 Fixed doxygen warning. 2013-09-28 12:55:32 +02:00