Commit Graph

1269 Commits

Author SHA1 Message Date
Sam Lantinga
e1683fad67 Added SDL_sqrtf(), SDL_tan(), SDL_tanf() 2014-06-07 18:20:01 -07:00
Gabriel Jacobo
01a18871e3 Chrome's Native Client backend implementation 2014-06-06 15:45:59 -03:00
Sam Lantinga
4f273fe6fb Fixed Mac OS X build 2014-06-04 16:35:07 -07:00
Sam Lantinga
667b15f3c8 Added annotations to help code analysis tools
CR: Bruce Dawson
2014-06-04 10:56:56 -07:00
Sam Lantinga
a7fe260d58 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal() 2014-06-04 10:55:26 -07:00
Sam Lantinga
15f5e2f1ab Added a hint to disable windows message processing in SDL_PumpEvents()
SDL_SetHint( SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP, "0" );
2014-06-04 10:52:34 -07:00
Sam Lantinga
afe35ca58c Added a hint to disable window frame and title bar interaction when the cursor is hidden 2014-06-04 10:50:32 -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
Jørgen P. Tjernø
dc73e037f2 SDL_opengl: Fix Mac build with new glext.h 2014-06-04 09:59:10 -07:00
Jørgen P. Tjernø
9fb5a56785 SDL_opengles2: Update to latest Khronos headers.
This updates to the latest Khronos headers, which gives the latest
headers for MSVC.

The following files were retrieved on 2014-06-04:

http://www.khronos.org/registry/gles/api/GLES2/gl2.h
http://www.khronos.org/registry/gles/api/GLES2/gl2ext.h
http://www.khronos.org/registry/gles/api/GLES2/gl2platform.h
http://www.khronos.org/registry/egl/api/KHR/khrplatform.h

And they were modified to not include each other themselves.
2014-06-04 01:35:36 -07:00
Jørgen P. Tjernø
3b8f839334 SDL_opengl: Update to glext.h from Khronos dated 2014-05-21.
This updates to the latest glext.h from Khorons that includes the OpenGL
4.4 specification. It was retrieved from
http://www.opengl.org/registry/api/GL/glext.h at 2014-06-04.
2014-06-04 01:32:52 -07:00
Jørgen P. Tjernø
07325a4583 SDL_opengles2: Separate out GLES2 headers. 2014-06-04 01:27:13 -07:00
Jørgen P. Tjernø
25ac29b42d SDL_opengl: Move glext.h to a separate file. 2014-06-04 01:21:00 -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
Philipp Wiesemann
b1242be50b Fixed typo in header comment. 2014-05-18 21:05:39 +02:00
Philipp Wiesemann
9227317d4d Fixed typo in header comment. 2014-05-11 15:59:22 +02:00
Gabriel Jacobo
7c86f42a25 Include gl2platform.h in SDL_opengles2.h so we play nice with GLEW.
Based on feedback from Sven Bergström
2014-05-10 17:00:37 -03:00
Dimitris Zenios
8adc9938a4 __ANDROID__ is the correct macro to check for an android system.ANDROID is only defined in NDK build system (.mk) and not in the standalone NDK. 2014-05-05 22:21:26 +03:00
Ryan C. Gordon
a256776578 Fix build on Windows targets without dxgi.h, like MingW32. 2014-05-06 00:13:07 -04: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
Sam Lantinga
fb78141616 Fixed bug 2508 - don't redefine WIN32_LEAN_AND_MEAN 2014-04-26 12:38:35 -07: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
Jørgen P. Tjernø
4d68f8c53e Render: Allow empty cliprect.
This fixes an issue where an empty cliprect is treated the same as a NULL
cliprect, causing the render backends to disable clipping.

Also adds a new API, SDL_RenderIsClipEnabled(render) that allows you to
differentiate between:
 - SDL_RenderSetClipRect(render, NULL)
 - SDL_Rect r = {0,0,0,0}; SDL_RenderSetClipRect(render, &r);

Fixes https://bugzilla.libsdl.org/show_bug.cgi?id=2504
2014-04-19 13:15:41 -07:00
Sam Lantinga
737576d21c SDL_DXGIGetOutputInfo() checks input parameters and returns a boolean value whether or not it succeeded. 2014-04-18 12:43:04 -07:00
Dimitris Zenios
07d07b460e Enable building of Android libraries using a standalone NDK 2014-04-06 00:30:48 +03:00
Philipp Wiesemann
16af15abb2 Fixed names of four hint environment variables. 2014-04-05 23:32:41 +02:00
Philipp Wiesemann
9578b1490c Fixed typos in header comments. 2014-04-05 23:22:21 +02:00
Philipp Wiesemann
84b4626929 Fixed doxygen comment in header. 2014-04-04 23:52:23 +02:00
Sam Lantinga
0097382ac2 Added an event SDL_RENDER_DEVICE_RESET, which is triggered on Direct3D 11 when the device has been lost and all textures need to be recreated. 2014-03-23 23:09:22 -07:00
David Ludwig
0982adf8fd WinRT: Got OpenGL ES 2 working with the latest version of ANGLE/WinRT.
SDL/WinRT did have support for OpenGL ES 2 via an older version of ANGLE/WinRT,
however its API changed a few months ago, and SDL/WinRT would crash when trying
to use it.  It would also occasionally crash when using the older version.

This changeset should make SDL/WinRT work with the latest version, as
available via MS Open Tech's git repository of it at
https://github.com/msopentech/angle

Older versions of ANGLE/WinRT (from either https://github.com/stammen/angleproject
or https://bitbucket.org/DavidLudwig/angleproject) will need to be updated to
MS Open Tech's latest version.
2014-03-22 20:48:18 -04:00
David Ludwig
9cf2124240 Fixed a build error in SDL_platform.h when using Code Blocks and MinGW
winapifamily.h, a header file specific to Microsoft's Windows 8 SDK, wasn't
getting found, which was leading to a build error.
2014-03-18 12:08:49 -04:00
Sam Lantinga
b0e0446659 Added missing copyright notices 2014-03-13 21:21:26 -07:00
Sam Lantinga
ae38d8e35e Windows XP toolchain fix from Bruce Dawson:
Fix to allow using SDL when compiling with v110_xp or v120_xp -- compiling with VS2012/VS2013 with the XP targeting option.

In order to ensure that we can target Windows XP we compile with the v120_xp toolset instead of v120. This means that we use an earlier SDK version and it means that winapifamily.h is not available. Compiling for this old SDK can be detected using the _USING_V110_SDK71_ define which is set through the %(PreprocessorDefinitions) option.
2014-03-12 23:44:23 -07:00
David Ludwig
55712a534c Fixed various build and runtime errors when using WinRT with VS2012. 2014-03-12 11:57:15 -04:00
Sam Lantinga
727845ddfd Fixed binary compatibility with the new Windows RT support 2014-03-10 19:11:52 -07:00
Sam Lantinga
02d4d38830 Temporarily disabled the D3D11 renderer so we can get a build. 2014-03-10 19:11:50 -07:00
Sam Lantinga
6b5a5ea12a Converted David Ludwig's D3D11 renderer to C and optimized it.
The D3D11 renderer is now slightly faster than D3D9 on my Windows 8 machine (testsprite2 runs at 3400 FPS vs 3100 FPS)
This will need tweaking to fix the Windows RT build.
2014-03-10 01:51:03 -07:00
Sam Lantinga
9939ffc251 Fixed compiling with mingw64 2014-03-09 12:08:07 -07:00
Sam Lantinga
0ae88759fb Integrated David Ludwig's support for Windows RT 2014-03-09 11:36:47 -07:00
Sam Lantinga
32547d0c59 Fixed line endings on WinRT source code 2014-03-09 11:06:11 -07:00
Sam Lantinga
c75b319a11 Updated SDL to version 2.0.3 2014-03-09 10:38:30 -07:00
Ryan C. Gordon
c6602d0b70 Mac: Added a hint to opt-out of new Spaces code. 2014-03-03 21:25:16 -05:00
Ryan C. Gordon
71e036e946 Reworked fullscreen policy on Mac OS X.
- SDL_WINDOW_FULLSCREEN works as always (change resolution, lock to window).
- SDL_WINDOW_FULLSCREEN_DESKTOP now puts the window in its own Space, and
  hides the menu bar, but you can slide between Spaces and Command-Tab between
  apps without the window minimizing, etc.
- SDL_WINDOW_RESIZABLE windows will get the new 10.7+ "toggle fullscreen"
  window decoration and menubar item. As far as the app is concerned, this is
  no different than resizing a window, but it gives the end-user more power.
- The hint for putting fullscreen windows into the Spaces system is gone,
  since Spaces can't enforce the requested resolution. It's a perfect match
  for FULLSCREEN_DESKTOP, though, so this is all automated now.
2014-03-02 12:45:51 -05:00
Sam Lantinga
a3680acb4a Changed SDL_HINT_ACCEL_AS_JOY to SDL_HINT_ACCELEROMETER_AS_JOYSTICK to be more clear. 2014-03-01 12:21:15 -08:00
Sam Lantinga
ef7c0b7e35 Added a hint to enable the screensaver by default 2014-02-28 14:23:41 -08:00
David Ludwig
f1438cb55e WinRT: simulate keyboard events on Windows Phone 8 back-button presses
Pressing the hardware back button on a Windows Phone 8 device will now cause SDL to emit a pair of key-down and key-up events, with the SDL scancode, SDL_SCANCODE_AC_BACK.

By default, if WinRT's native back-button-press events are not explicitly marked as 'handled', then Windows Phone will terminate the app.  More details on Microsoft's reasoning behind this can be found on MSDN, at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx

To mark back-button-press events as 'handled', set SDL_HINT_WINRT_HANDLE_BACK_BUTTON to 1.  Setting it to anything else will cause these events to not be marked as 'handled'.

Due to limitations in Windows Phone's APIs, SDL will emit a virtual key-up event immediately after the back button's key-down event is registered.  Unfortunately, Windows Phone 8 only allows one to register for back-button-press events, and not back-button-release events.
2014-01-26 08:06:36 -05:00
David Ludwig
dd661ff38c WinRT: added a means to display a privacy policy link via the Settings charm
This change is only relevant for Windows 8, 8.1, and RT apps, and only for those that are network-enabled.  Such apps must feature a link to a privacy policy, which must be displayed via the Windows Settings charm.  This is needed to pass Windows Store app-certification.

Using SDL_SetHint, along with SDL_HINT_WINRT_PRIVACY_POLICY_URL and optionally SDL_HINT_WINRT_PRIVACY_POLICY_LABEL, will cause SDL/WinRT to create a link inside the Windows Settings charm, as invoked from within an SDL-based app.

Network-enabled Windows Phone apps do not need to set this hint, and should provide some sort of in-app means to display their privacy policy.  Microsoft does not appear to provide an OS-integrated means for displaying such on Windows Phone.
2014-01-01 16:05:37 -05:00
David Ludwig
9ddee1ffb6 WinRT: enabled OpenGL ES 2 support by default
A copy of ANGLE/WinRT is still needed to run OpenGL content, but is not needed to compile SDL/WinRT.
2013-12-21 10:08:11 -05:00
Sam Lantinga
3a66c3ccbc Fixed bug 2346 - Mac: mousewheel events have flipped horizontal scroll values
Alex Szpakowski

On my Mac OS X system (10.9.1), the SDL_MOUSEWHEEL event reports negative X values when my trackpad scrolls to the right, and positive X values when my trackpad scrolls to the left. This is backwards from what I'd expect, and I don't think it matches the Windows wheel events.

The vertical scroll values are what I'd expect though, and are consistent what gets reported on Windows (positive Y for scrolling up, negative Y for scrolling down.)

This is with "scroll direction: natural" disabled in the OS X trackpad settings (i.e. my scroll direction in non-SDL OS X programs matches what happens in Windows and Linux.)

I also tested with the horizontal scroll on a real mouse (Logitech G500 without custom drivers), and the horizontal scroll values in SDL are still flipped.

I "solved" the issue for myself by changing this line in the Cocoa_HandleMouseWheel function:

    float x = [event deltaX];

to this:

    float x = -[event deltaX];

I believe it should work fine with that change - I found something similar in another codebase while looking online for my issue - but I haven't tested on anything below Mac OS 10.8.
2014-02-22 14:57:12 -08:00
Philipp Wiesemann
c061c5613a Fixed documentation comments in SDL_hints.h file. 2014-02-16 00:04:15 +01:00