Commit Graph

94 Commits

Author SHA1 Message Date
Sam Lantinga
2d11869712 Fixed bug 4159 - Windows headers are included after packing alignment change
lectem

The SDL_syswm.h header includes the windows.h header after including begin_code.h which changes the structure packing alignment.

It seems this is not safe as suggested by the following warning :
warning C4121: 'JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2': alignment of a member was sensitive to packing
2018-05-07 19:26:02 -07:00
Sam Lantinga
a9072159b2 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
92e355a484 Fixed bug 3752 - minor os2 defines
Ozkan Sezer

Attached three patches, so these minor os/2 bits get registered mainstream:

1. SDL_syswm.h: add SDL_SYSWM_OS2 to SDL_SYSWM_TYPE enum
2. SDL_platform.h: recognize __EMX__ too as __OS2__
3. begin_code.h: set SDLCALL as _System for OS/2.
2017-08-14 10:15:38 -07:00
Ryan C. Gordon
b10e95e1f3 syswm: prevent buffer overflow if SDL and app have different config headers.
This only affects Wayland and DirectFB, as a Unix system generally has X11
support. Other platforms also have different sizes for the C union in
question, but are likely the only target for that platform, etc.

Apps that might run on Wayland or DirectFB will need to be compiled against
new headers from an official 2.0.6 release, or be prepared to force the x11
target, or not use SDL_GetWindowWMInfo().

Fixes Bugzilla #3428.
2017-06-11 00:50:26 -04:00
Philipp Wiesemann
3b2e0bf33c Fixed comments in headers for doxygen output. 2017-06-04 23:15:39 +02:00
Sam Lantinga
d77ab77a7a Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
9cc7ce9008 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Sam Lantinga
c6e13cd484 Fixed bug 3486 - Can't get HINSTANCE of my window
realitix

SDL2 allows to create widow and to get information through SDL_SysWMinfo.
But it misses something, with Vulkan, you need the HWND and HINSTANCE of the window for Win32 system.
Sadly, SDL2 provides only HWND but not HINSTANCE.

In some context, it can be difficult to get the HINSTANCE, indeed, I'm using pySDL2 (Python) and I can only access properties that SDL2 gives me.
I have to use a dirty trick like that to get the HINSTANCE:  (https://raw.githubusercontent.com/bglgwyng/pyVulkan/master/examples/win32misc.py)
2016-11-20 21:18:55 -08:00
Sam Lantinga
27224491cb Expose the EGL display and window for Vivante SDL windows 2016-01-16 21:58:49 -08:00
Sam Lantinga
255c182471 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Alex Szpakowski
e92a6c4d82 Added MSAA support for OpenGL ES contexts on iOS.
Note that extra steps must be taken when using glReadPixels to read the contents of the main OpenGL ES framebuffer on iOS, if multisampling is used. See the OpenGL ES section of README-ios.md for details.
2015-07-19 19:44:40 -03:00
Sam Lantinga
78f2198e6c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Alex Szpakowski
54454c2671 Fixed a warning when SDL_syswm.h is included in code compiled for iOS with clang. 2015-05-05 16:24:05 -03:00
Alex Szpakowski
03a3b1872d Added framebuffer and colorbuffer members to the uikit portion of the SDL_SysWMinfo struct, removed SDL_iOSGetViewRenderbuffer and SDL_iOSGetViewFramebuffer.
--HG--
branch : iOS-improvements
2015-04-09 19:28:00 -03:00
Ryan C. Gordon
d5b50f68e2 Windows: Report window HDC in SDL_SysWMinfo.
Fixes Bugzilla #2668.
2015-03-23 19:47:08 -04:00
Jørgen P. Tjernø
52538ec24d Mac: Fix build with clang from Xcode 6. 2014-09-30 11:20:50 -07:00
Sam Lantinga
77c675e192 Better check for __has_feature 2014-08-19 22:04:54 -07:00
Sam Lantinga
bc7e9df1f0 Fixed bug 2694 - configure bug __has_feature macro not detected
skaller

using gcc 4.2 (the default) on Mac OSX 10.6.8

 CC     build/SDL_dynapi.lo
In file included from /Users/johnskaller/SDL/src/dynapi/SDL_dynapi.c:31:
include/SDL_syswm.h:211:39: error: missing binary operator before token "("

The fault appears to be here:

#if defined(__OBJC__) && __has_feature(objc_arc)

that the __has_feature macro is not supported by gcc 4.2.

The code works fine with my clang 3.3svn.
2014-08-19 21:17:21 -07:00
Ryan C. Gordon
3589da6bd2 Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Fixes Bugzilla #2641.
2014-07-30 14:14:19 -04:00
Jørgen P. Tjernø
9567586894 Apply WIN32_LEAN_AND_MEAN redefine fix to SDL_syswm.h too.
This is related to 7a261af2d612, which fixes bug 2508.
2014-06-30 17:22:08 -07:00
Jørgen P. Tjernø
cd224fd892 SDL_opengl: Fix Mac build for SDK 10.9 too. 2014-06-04 10:33:23 -07:00
Sam Lantinga
1de08260b6 Added a way to get the native Android window and EGL context 2014-06-02 09:01:26 -07:00
Ryan C. Gordon
df87f9051a Removed comma at end of enum in a public header, to make -Wpedantic happy. 2014-04-29 12:00:28 -04:00
Brandon Schaefer
ad8ea09710 Revert MIR_CFLAGS to SDL_CFLAGS. Use forward declaration for the real fix. (We shouldn't expose mir headers!) 2014-04-21 12:42:25 -07:00
Sam Lantinga
727845ddfd Fixed binary compatibility with the new Windows RT support 2014-03-10 19:11:52 -07:00
Sam Lantinga
0ae88759fb Integrated David Ludwig's support for Windows RT 2014-03-09 11:36:47 -07:00
Ryan C. Gordon
3031403652 Added some SysWM bits for Mir. 2014-02-02 23:53:48 -05:00
Ryan C. Gordon
781022f33d Added Mir video target (thanks, Brandon!). 2014-02-02 23:41:46 -05:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Gabriel Jacobo
f66facb2a7 Preserve binary compatibility in SDL_SYSWM_TYPE (thanks Gerry JJ!)
Also moved Wayland structures to the bottom of the union for OCD related issues.
2014-01-28 09:13:46 -03:00
Gabriel Jacobo
74cba7bdbe Wayland support
Based on the original port to Wayland by: Joel Teichroeb, Benjamin Franzke, Scott Moreau, et al.

Additional changes in this commit, done by me:

* Wayland uses the common EGL framework
* EGL can now create a desktop OpenGL context
* testgl2 loads GL functions dynamically, no need to link to libGL anymore
* Assorted fixes to the Wayland backend

Tested on the Weston Compositor (v1.0.5) that ships with Ubuntu 13.10,
running Weston under X. Tests ran: testrendercopyex (all backends), testgl2, testgles2,testintersections
2013-12-14 20:18:43 -03:00
David Ludwig
e7a27315f9 WinRT: made SDL_GetWindowWMInfo return window data in a slightly easier-to-use format
Having the window pointer available as a WinRT IInspectable should make it a bit easier to use in conjunction with WRL-based weak references.
2013-09-16 11:02:18 -04:00
David Ludwig
f34ae4e23f WinRT: more "Windows RT" to "WinRT" renaming 2013-08-27 12:20:35 -04:00
David Ludwig
669aa12b7e WinRT: renamed SDL_SYSWM_WINDOWSRT to SDL_SYSWM_WINRT
This is part of an overall effort to use the name, "WinRT", rather than "WindowsRT" (or "Windows RT"), as the shorthand name often seems to mean something different than the longhand name.  (WinRT is an API, Windows RT is a product name)
2013-08-27 11:44:43 -04:00
David Ludwig
373ffd0dac WinRT: merged with SDL 2.0.0 codebase (aka. SDL hg rev d6a8fa507a45) 2013-08-12 22:29:55 -04:00
Sam Lantinga
8ab710e751 Fixed code example for SDL_GetWindowWMInfo() 2013-07-14 11:57:01 -07:00
Sam Lantinga
cdc319cb12 This patch isn't needed because you have the window and can do [nswindow contentView] yourself.
I'm rolling this back so we minimize the things exposed that we have to keep consistent in the API.
2013-06-05 21:31:22 -07:00
Sam Lantinga
91acc847ca Fixed bug 731 - No mechanism to extract the NSView for 3d library 2013-05-20 22:05:49 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
David Ludwig
48c5ee264e WinRT: made SDL's inner WinRT CoreWindow be accessible to non-C++/CX code, in theory 2013-04-16 23:40:03 -04:00
David Ludwig
db53df0697 WinRT: merged with latest, official, SDL 2.x code 2013-02-23 20:01:46 -05:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
David Ludwig
aa44094749 WinRT: provided access, via SDL_GetWindowWMInfo, to SDL's WinRT CoreWindow 2013-02-09 14:35:06 -05:00
David Ludwig
76266d0aae added UIViewController pointer to SDL_SysWMinfo for iOS 2012-07-18 22:26:47 -04:00
Sam Lantinga
e256711bb9 Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
6196aa221e SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
a2cdcf5486 Happy 2011! :) 2011-02-11 22:37:15 -08:00
Sam Lantinga
b31aaaaad7 Updated the DirectFB support, from Couriersud
attached is a working directfb driver diff which works with the current
changes. There are a number of changes around it as well, e.g.
configure.in.

The directfb renderdriver right now still depends on a some "includes"
from src/video/directfb. That's why it is not yet moved to the new
render folder.
2011-02-05 16:07:10 -08:00
Sam Lantinga
7f59b3b677 Fixed compile error on Mac OS X 2011-01-21 11:23:19 -08:00
Sam Lantinga
3f8169298d You can't have an empty union in the structure... 2011-01-20 18:09:55 -08:00