Commit Graph

1718 Commits

Author SHA1 Message Date
Alex Szpakowski
19f09c82c3 Updated the iOS backend code to use Objective-C's automatic reference counting (ARC).
--HG--
branch : iOS-improvements
2014-08-06 03:24:16 -03:00
Sam Lantinga
90c885ed9b Haptics aren't available on iOS, but use the dummy implementation instead of failing init if it's requested. 2014-08-05 21:03:02 -07:00
Alex Szpakowski
6a15f46238 Merged 'default' into branch 'iOS-improvements'
--HG--
branch : iOS-improvements
2014-07-31 03:14:10 -03: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
Gabriel Jacobo
4f3a0f0ff1 Rearrange documentation
1) Moves all READMEs to docs/
2) Renames them to *.md, adds some Markdown with the idea to add a lot more
3) Moves the doxyfile config to doc/ and makes it parse the headers at ../include as well as the md files in docs.
4) Skips SDL_opengl*.h headers from the docs
5) Minor fixes to doxyfile
2014-07-29 09:20:12 -03:00
Alex Szpakowski
9236ac4d12 Added support for SDL_SetWindowBordered on iOS. Worked around a bug with rotating the device on iOS 8.
--HG--
branch : iOS-improvements
2014-07-29 00:05:48 -03:00
Ryan C. Gordon
d9bca52776 Changed local var names in SDL assert macro.
Otherwise, if someone added an assert to a function that has a variable
named "state", the compiler might warn about shadowing a local.
2014-07-28 10:54:25 -04:00
Ryan C. Gordon
01187b701d Added audio device buffer queueing API. 2014-07-22 21:41:49 -04:00
Alex Szpakowski
9e004cf9cb iOS now respects SDL_HINT_ACCELEROMETER_AS_JOYSTICK.
--HG--
branch : iOS-improvements
2014-07-15 02:01:43 -03:00
Alex Szpakowski
8e811c6753 Misc. iOS code improvements.
- Use @autoreleasepool instead of NSAutoReleasePool.

- Code style fixups.

--HG--
branch : iOS-improvements
2014-07-14 16:50:25 -03:00
Sam Lantinga
7f1561039c Fixed bug in AVX detection and added AVX2 detection 2014-07-11 22:02:50 -07:00
Sam Lantinga
78a56d7ce5 Clarified the documentation for SDL_FlushEvents() so people know it only affects currently queued events. 2014-07-09 01:34:40 -07:00
Ryan C. Gordon
1e15283c66 Comment update: SDL_INIT_NOPARACHUTE doesn't do anything as of 2.0.0. 2014-07-08 16:17:06 -04:00
Sam Lantinga
8c5fdb70a9 Fixed bug 2618 - incomplete pthread-based lock support should be removed
binarycrusader

Since changeset 358696c354a8, SDL 2.0 has been broken on Solaris when compiling with the Solaris Studio compiler (which uses the pthread implementation of SDL_AtomicLock).

Notably, it gets stuck at the MemoryBarrierRelease in SDL_GetErrBuf:

6585 # 218
6586     if (!tls_errbuf && !tls_being_created) {
6587          SDL_AtomicLock_REAL ( & tls_lock );
6588         if (!tls_errbuf) {
6589             SDL_TLSID slot;
6590             tls_being_created = SDL_TRUE;
6591             slot =  SDL_TLSCreate_REAL ( );
6592             tls_being_created = SDL_FALSE;
6593              { SDL_SpinLock _tmp = 0 ; SDL_AtomicLock_REAL ( & _tmp ) ; SDL_AtomicUnlock_REAL ( & _tmp ) ; };
^^^ loops forever above
6594             tls_errbuf = slot;
6595         }
6596          SDL_AtomicUnlock_REAL ( & tls_lock );
6597     }


Running: testthread
(process id 28926)
^Cdbx: warning: Interrupt ignored but forwarded to child.
signal INT (Interrupt) in __nanosleep at 0xfe52a875
0xfe52a875: __nanosleep+0x0015: jae      __nanosleep+0x23   [ 0xfe52a883, .+0xe ]
Current function is SDL_Delay_REAL
  204           was_error = nanosleep(&tv, &elapsed);
(dbx) where
  [1] __nanosleep(0xfeffe848, 0xfeffe850, 0xfe75a5ac, 0xfe5169d8), at 0xfe52a875
  [2] nanosleep(0xfeffe848, 0xfeffe850), at 0xfe516a3b
=>[3] SDL_Delay_REAL(ms = 0), line 204 in "SDL_systimer.c"
  [4] SDL_AtomicLock_REAL(lock = 0xfeffe88c), line 104 in "SDL_spinlock.c"
  [5] SDL_GetErrBuf(), line 225 in "SDL_thread.c"
  [6] SDL_ClearError_REAL(), line 216 in "SDL_error.c"
  [7] SDL_InitSubSystem_REAL(flags = 0), line 116 in "SDL.c"
  [8] SDL_Init_REAL(flags = 0), line 244 in "SDL.c"
  [9] SDL_Init(a = 0), line 89 in "SDL_dynapi_procs.h"
  [10] main(argc = 1, argv = 0xfeffe948), line 65 in "testthread.c"

As far as I can tell, this is because pthread_spin_trylock() always returns EBUSY for this particular lock; since it works in other places, I'm suspicious.

Different Solaris Studio compiler versions seem to make no difference.

I've verified this is broken on Linux as well if SDL_spinlock.c is modified to use the pthread implementation.

This appears to be because pthread_spin_init() and pthread_spin_destroy() are not used with the locks as required.
2014-07-07 21:27:42 -07:00
Shawn Walker
f0b0159135 2620 solaris port missing atomics if not using gcc 2014-07-05 16:11:23 -07:00
David Ludwig
639d7060c7 Made the latest XInput + Haptic changes compile and run on WinRT
Notes:
- Support for the 'Guide' button does not seem to be possible, as
  XInputGetStateEx is not available on WinRT.
- Haptic support appears to be working on WinRT now!
- SDL/WinRT does not allow calls to LoadLibrary or LoadLibraryEx.  The calls
  to those were removed by this change, but only when compiling for WinRT.
  Non-WinRT Windows will continue to detect and load XInput via LoadLibrary and
  GetProcAddress calls.
2014-07-04 18:20:23 -04:00
Sam Lantinga
6dd1e2f2f6 Split the XInput and DirectInput code so Windows RT can use the existing XInput support. 2014-07-03 15:39:55 -07:00
Alfred Reynolds
4d28ba8b0f add a comment to SDL_InitSubSystem explaining its refcounting behavior 2014-07-03 10:22:26 -07: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
Knut Andre Tidemann
4c458c93af SDL_egl: allow creation of versioned OpenGL contexts with EGL_KHR_create_context
If the EGL extension EGL_KHR_create_context is available, we can use it to
set the core/compatability profile and the minimum OpenGL version.

Use this if it is available to get the context requested by the GL attributes.
2014-06-28 12:17:29 -03:00
Ryan C. Gordon
e59e44ff6b Merged Ryan's SDL-gui-backend branch.
Adds three APIs, and implements them on X11, Cocoa, and Windows:

- SDL_CaptureMouse()
- SDL_GetGlobalMouseState()
- SDL_SetWindowHitTest()
2014-06-25 17:06:12 -04:00
Ryan C. Gordon
25c056b0ae Changed SDL_GetAbsoluteMouseState() to SDL_GetGlobalMouseState().
This matches naming conventions in the main repository, between
 SDL_GetRelativeMouseState() and SDL_WarpMouseGlobal().
2014-06-25 16:16:55 -04:00
Sam Lantinga
5a816a6c2c Fixed bug 2603 - iOS: update joystick accelerometer code to use CoreMotion instead of the deprecated UIAccelerometer
Alex Szpakowski

SDL's code for exposing the accelerometer as a joystick on iOS currently uses UIAccelerometer, which was superseded by the CoreMotion framework and deprecated since iOS 5.

The UIAccelerometer code still works (for now), but it also throws deprecation warnings whenever SDL is built for iOS, since SDL's deployment target is no longer below iOS 5.

I've created a patch which replaces the old UIAccelerometer code with a replacement based on the CoreMotion framework. It has identical functionality (to SDL users), however iOS apps are now required to link to the CoreMotion framework when using SDL.
2014-06-25 00:20:21 -07:00
Sam Lantinga
b09fd2c550 Fixed bug 2553 - Add support to all XInput devices
This adds support for all XInput devices, exposed through the SDL joystick API.
The button and axis reporting for XInput devices has been changed to match DirectInput and other platforms.
The game controller xinput mapping has been updated so this change is seamless.
There is a new hint, SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING, for any applications that have hardcoded the old xinput button and axis set. This hint will be removed in SDL 2.1.
2014-06-24 13:31:25 -07:00
Sam Lantinga
2582c3aa59 Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings 2014-06-23 11:06:50 -07:00
Sam Lantinga
b69ed39252 Merged changes from Alexey Petruchik to support Android obb files
http://developer.android.com/google/play/expansion-files.html
2014-06-21 20:35:36 -07:00
Sam Lantinga
12fde88e2f Fixed bug 2563 - Remove obsolete code for supporting iOS < 5
Alex Szpakowski

Now that SDL for iOS requires at least iOS 5.1 at runtime, there are several old codepaths in the UIKit backend which can be removed. I've attached a patch which does so.
2014-06-21 12:43:57 -07:00
Alex Baines
3450ee34f3 Add IBus IME Support, move DBus code to its own file. (v3.3 squashed) 2014-06-18 20:11:39 +01:00
Sam Lantinga
fee876047b commit 9e211e646f9d51dc1372c9f3c8f47a78caf4f2a5
Author: Sam Clegg <sbc@chromium.org>
Date:   Fri Jun 20 12:52:11 2014

    Fix win32 build which was failing due to missing PRIs64.

    This change adds definitions for the C99 PRIs16 and PRIu64
    which are missing from <stdint.h> on at last win32 and
    possibly other platforms.

    These already existed in testgesture.c so I removed them
    from there also.
2014-06-21 11:24:06 -07:00
Sam Clegg
5cc37d29ec Fix compiler warnings in Native Client and Linux builds. 2014-06-20 11:10:16 -03:00
Gabriel Jacobo
fa3bf63b5c Initialize nacl_io, removes SDL_NaClMount/Umount
It's just easier to use nacl_io's mount/umount directly.
2014-06-20 10:59:51 -03:00
Sam Lantinga
b831cdf53b Fixed bug 2568 - NO_SDL_GLEXT should prevent OS glext.h as well
Jørgen Tjernø

If you #define NO_SDL_GLEXT before including SDL_opengl.h, it still includes the platform-provided glext.h. The comments indicate that this define is intended to be used when you provide your own glext.h (quote from SDL_opengl.h: "Define this if you have your own version of glext.h and want to disable the version included in SDL_opengl.h.")

This is a problem because glext.h depends on the contents of gl.h, and it's practical to let SDL_opengl.h pick the right #include for gl.h for our platform.
2014-06-15 17:37:35 -07:00
Gabriel Jacobo
adce68ed69 Fixes audio for Native Client, and other fixes...
- SDL_NaClMount, SDL_NaClUmount
- Default mounting of https at / in SDL's main function
- More documentation in README-nacl.txt
2014-06-08 18:18:13 -03:00
Sam Lantinga
85e4bbb06b The NaCL mount/unmount functions need to be in SDL_system.h and specific to NaCL 2014-06-08 12:05:17 -07:00
Philipp Wiesemann
7a56b7d768 Fixed doxygen comment in header. 2014-06-08 13:01:04 +02:00
Philipp Wiesemann
38942661e7 Fixed typo in source comment. 2014-06-08 12:51:02 +02:00
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
Philipp Wiesemann
799609d230 Fixed typos in header file documentation comments. 2015-04-22 21:43:22 +02:00
Philipp Wiesemann
b7f2594c20 Fixed SDL_GameControllerOpen() and SDL_JoystickOpen() documentation in header. 2015-04-20 20:03:40 +02:00
Philipp Wiesemann
5a0e021241 Fixed unsupported doxygen tag in header file. 2015-04-20 20:03:26 +02:00
Ionut Leonte
686a5dabf5 Added SDL_HITTEST_RESIZE_*, and implemented for X11. 2014-06-05 00:45:16 -04:00
Ryan C. Gordon
1c00a0fc42 Implemented SDL_GetAbsoluteMouseState().
X11 only for now, but this should be doable on every platform, I think.
2014-06-05 00:03:33 -04: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
Ryan C. Gordon
79ae1a2719 Fixed using SDL_PointInRect() from C++. 2014-05-30 09:50:47 -04:00
Ryan C. Gordon
61463598b2 Tweaked hit-testing documentation. 2014-05-29 13:38:39 -04:00
Ryan C. Gordon
7af1c6e050 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.
2014-05-28 01:22:47 -04:00
Ryan C. Gordon
6146fd1f61 First shot at SDL_SetWindowDragAreas().
Only Cocoa implemented right now.
2014-05-27 01:27:42 -04:00
Ryan C. Gordon
22f1b394d6 Added SDL_PointInRect(). 2014-05-27 00:26:47 -04:00
Ryan C. Gordon
c28b3364b0 Implemented SDL_CaptureMouse(). 2014-05-24 01:30:37 -04:00
stopiccot
17b9ef82d9 Fixing issues discovered by Philipp Wiesemann
--HG--
branch : apk
2014-04-23 03:42:32 +03:00
stopiccot
df6159bfef inital apk extension support
--HG--
branch : apk
2014-04-07 21:20:39 +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
Sam Lantinga
adf7311ba7 Back out changelist 1951976 2014-02-13 11:05:34 -08:00
Sam Lantinga
38e55d5f40 Added SDL_DXGIGetOutputInfo which returns the adapter and output indices that are used to create DX10 and DX11 devices and swap chains on a particular display.
CR: SamL
2014-02-13 11:05:30 -08:00
Sam Lantinga
18a7c93e52 Added SDL_GetLoadedModule to do the equivalent of GetModuleHandle/dlload(NOLOAD)
CR: Jorgen
2014-02-13 11:05:24 -08:00
Sam Lantinga
bac409c888 Recreate render target textures when the D3D device is being reset, and notify the application using the SDL_RENDER_TARGETS_RESET event when this happens. 2014-02-10 10:02:51 -08:00
Sam Lantinga
e987abc343 Exposed the font character size and SDLTest_DrawCharacter() to make it easier to do custom debug text layout 2014-02-10 10:02:42 -08:00
Sam Lantinga
1af9aa0b1e Updated SDL to version 2.0.2 2014-02-09 03:09:56 -08:00
Ryan C. Gordon
a18eec16cc Make non-Clang compilers happy. 2014-02-07 11:55:13 -05:00
Ryan C. Gordon
241fc337a8 Tell Clang's static analysis that SDL_assert() is an assertion handler.
This lets it know, for example, that when you do this...

    SDL_assert(ptr != NULL);

...that (ptr) is definitely not NULL at this point in the program, for the
sake of static analysis. While a buggy program could definitely trigger this
assertion, Clang assumes your assertion check is covering it and won't
report possible NULL dereferences after this point.

Since SDL_assert might continue if the user clicks "ignore", without this
change Clang would notice you checked for NULL (meaning that NULL is a real
possibility here) and still wrote code outside of that test branch that
dereferences the pointer, and thus would always trigger false positives.

Static analysis is fun!
2014-02-07 11:52:35 -05:00
Ryan C. Gordon
3985954d03 SDL_pixels.h needs SDL_stdinc.h for SDL_FOURCC #define (thanks, Dmitry!).
Fixes Bugzilla #2384.
2014-02-05 00:34:26 -05:00
Ryan C. Gordon
bbe5c7aaee Added SDL_GetAssertionHandler() and SDL_GetDefaultAssertionHandler(). 2014-02-04 11:38:40 -05:00
Ryan C. Gordon
e8b47266fd Hooked up dynamic loading for Mir. 2014-02-03 11:52:54 -05: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
Philipp Wiesemann
e94925fc40 Added additional platform check for __ANDROID__.
The macro ANDROID was deprecated with "android-ndk-1.6_r1".
2014-02-02 20:55:42 +01:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Sam Lantinga
921f2abe11 Fixed bug 2376 - no SDL_HasAVX
Haneef Mubarak

AVX is the successor to SSE* and is fairly widely available. As such, it really ought to be detectable.

This functionality ought to be trivial to implement, and not having it means being forced to write an ugly workaround to check for AVX (so that normal SSE can be used if AVX is not available).

Here is an example on detecting AVX from SO (it actually shows ways to cehck for all of teh fancy instructions):

http://stackoverflow.com/questions/6121792/how-to-check-if-a-cpu-supports-the-sse3-instruction-set
2014-02-02 00:33:31 -08:00
Jørgen P. Tjernø
7e4c549afe Add SDL_GL_ResetAttributes. 2014-01-29 18:38:13 -08:00
Sam Lantinga
7490c5a28f Add a new hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT that allows SDL_CreateWindowFrom() to set the pixel format of another SDL_Window (and also will set the SDL_WINDOW_OPENGL flag on the window created with SDL_CreateWindowFrom()).
The reasoning behind this change is that source2 in -tools mode has a single OpenGL context that is used with multiple different windows.  Some of those windows are created outside the engine (i.e. with Qt) and therefore we need to use SDL_CreateWindowFrom() to get an SDL_Window for those.  The requirement for sharing an OpenGL context across multiple different windows is that each window has the same pixel format.  To facilitate this, I now set SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT for the main window before calling SDL_CreateWindowFrom().  When I do this, SDL_CreateWindowFrom() will:

1. Set the pixel format of the returned window to the same pixel format as this SDL_Window passed in with the hint
2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for OpenGL rendering.

I only currently implemented this for Win32/WGL so implementing it for other platforms (i.e. X11) remains a TODO.

CR: SamL

Some pseudocode that shows how this is used in Source2:

HWND hExternalHwnd; // HWND that was established outside of SDL

// Create main window (happens inside platwindow.cpp)
SDL_Window *mainWindow = SDL_CreateWindow( , SDL_WINDOW_OPENGL .. );
// Create GL context, happens inside rendersystemgl
SDL_GLContext onlyContext = SDL_GL_CreateContext( mainWindow );

// Now I need to create another window from hEternalHwnd for my swap chain that will have the same pixel format as mainWindow, so set the hint
SDL_SetHint( SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT, CFmtStr( %p, mainWindow) );

// Create the secondary window.  This returned window will have SDL_WINDOW_OPENGL set and share a pixel format with mainWindow from the hint
SDL_Window *secondaryWindow = SDL_CreateWindowFrom( hExternalHwnd );

// To render to the main window:
SDL_GL_MakeCurrent( mainWindow, onlyContext );
// Do some rendering to main window

// To render to the secondary window:
SDL_GLMakeCurrent( secondaryWindow, onlyContext );
// Do some rendering to secondary window
2014-01-30 12:30:40 -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
7396953eb6 Dynamic loading support for Wayland 2014-01-09 13:56:21 -03:00
Ryan C. Gordon
3dfc14ade2 Implemented the Dynamic API magic. 2013-12-09 16:03:18 -05:00
David Ludwig
9e74de85a0 WinRT: removed a now-complete TODO comment regarding Direct3D 11 2013-11-29 00:21:56 -05:00
David Ludwig
b13b8b6290 WinRT: enable the OpenGL ES 2 SDL_Renderer backend, if and when OpenGL ES 2 support is compiled in 2013-11-29 00:19:46 -05:00
David Ludwig
e598d85856 WinRT: got the SDL-official OpenGL ES 2 changes working, in an experimental state 2013-11-28 22:59:21 -05:00
David Ludwig
c96c4f3dc4 WinRT: merged with latest SDL 2.x/HG code
SDL 2.x recently accepted patches to enable OpenGL ES 2 support via Google's ANGLE library.  The thought is to try to eventually merge SDL/WinRT's OpenGL code with SDL-official's.
2013-11-28 22:09:21 -05:00
Gabriel Jacobo
7f94f11314 Fixes #2271, Add KD detection under CMake by Scott Percival 2013-11-26 11:50:54 -03:00
Ryan C. Gordon
258c05aa3e We don't need to check for snprintf() anymore, we don't use it.
SDL_snprintf() is built on vsnprintf() where available.
2013-11-24 23:36:15 -05:00
Ryan C. Gordon
df9f367941 Added SDL_vsscanf(). 2013-11-24 23:35:38 -05:00
Ryan C. Gordon
19706b10e9 Moved atomic API implementation out of headers. 2013-11-24 21:04:51 -05:00
Sam Lantinga
eff7d88566 Bump SDL to build with 10.7 SDK.
This also bumps the minimum requirement for building SDL to 10.7, and
removes some checking we no longer need.

CR: saml
2013-12-27 10:18:11 -08:00
Gabriel Jacobo
08ed2e33eb Implements touch support on QTWayland. Contributed by Thomas Perl. 2013-12-27 09:29:39 -03:00
Sam Lantinga
ad17e4ec0c Added a relative mouse mode that uses mouse warping instead of raw input.
To enable this, set the environment variable SDL_MOUSE_RELATIVE_MODE_WARP to "1"

When mouse relative mode is disabled, put the cursor back where the application expects it to be, instead of where it was when relative mode was enabled.
2013-12-23 17:37:22 -08:00
Sam Lantinga
85c6638510 Added support for double-clicks, through a new "clicks" field in the mouse button event. 2013-12-23 12:17:52 -08:00
Gabriel Jacobo
2932d59103 [Android] Define SDL_VIDEO_OPENGL_ES2 2013-12-16 10:03:26 -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
Ryan C. Gordon
fac8b02737 Hook up SDL_acos and SDL_asin properly. 2013-12-09 15:17:20 -05:00
Sam Lantinga
1353c6ab1a Added missing header for file IO 2013-12-05 09:54:22 -08:00
Gabriel Jacobo
7deb0ea7c9 Adds SDL_GameControllerAddMappingsFromRW, updates controllermap
SDL_GameControllerAddMappingsFromFile is now a convenience macro.

controllermap can now skip bindings by pressing space or clicking/touching the
screen.
2013-12-03 12:01:28 -03:00
Gabriel Jacobo
0386a9d033 Adds SDL_GameControllerAddMappingsFromFile 2013-12-02 19:34:08 -03:00
Ryan C. Gordon
b6c28469d6 Fixed a few public APIs that we accidentally neglected to mark as SDLCALL.
Fixes Bugzilla #2262.
2013-11-23 15:52:49 -05:00
Gabriel Jacobo
3fcc35f5bb OpenGL ES support for Windows 2013-11-22 13:24:53 -03:00
Sam Lantinga
f040fbe866 Fixed bug 2245 - add SDL_acos and SDL_asin
Sylvain

Here's some code to add arc cosine, and arc sin functions to SDL_stdlib.c
There are plainly written using SDL_atan.
2013-11-16 18:56:02 -08:00
Sam Lantinga
fc5aad869c Added space in the common state structure for render targets 2013-11-15 22:01:58 -08:00
Ryan C. Gordon
b444dd2714 Renamed things named after BeOS to be named after Haiku instead. 2013-11-14 11:51:24 -05:00
Ryan C. Gordon
a71d349f7c Added SDL_DetachThread() API. 2013-11-14 00:52:39 -05:00
Ryan C. Gordon
ee4465fe4f Started BeOS removal: merged BeOS thread and pthread code.
Haiku uses most of the standard pthread API, with a few #ifdefs where we
still need to fallback onto the old BeOS APIs.

BeOS, however, does not support pthreads (or maybe doesn't support it well),
so I'm unplugging support for the platform with this changeset. Be Inc went
out of business in 2001.
2013-11-13 22:35:26 -05:00
Sam Lantinga
2a92dbcd37 Added a hint SDL_HINT_VIDEO_FULLSCREEN_SPACES to specify that windows go fullscreen into their own spaces on Mac OS X. 2013-11-12 01:52:54 -08:00
Ryan C. Gordon
d42a23e505 Added Ben Henning's GSoC2013 work: premake build system. 2013-11-10 00:38:37 -05:00
Sam Lantinga
9bd79544c7 Added SDL_HINT_CTRL_CLICK_EMULATE_RIGHT_CLICK hint which controls whether ctrl+click should emulate a right click on OSX. 2013-11-08 14:04:51 -08:00
Gabriel Jacobo
515ee991e4 Adds Joystick support for Android
This bumps the build SDK level to 12 (up from 10). Runtime requirements remain
the same (at API level < 12 joystick support is disabled).

Also enables building SDL for armv7 and x86.
2013-11-05 20:07:39 -03:00
David Ludwig
f37624a829 WinRT: added experimental OpenGL ES 2.0 support
A port of the ANGLE library (OpenGL ES 2.0 for Direct3D) to WinRT, via https://github.com/stammen/angleproject, is used as a base.

To enable, clone 'angleproject' into the directory one above where SDL/WinRT is, open the file SDL/include/SDL_config_winrt.h, and uncomment the #defines that begin with 'SDL_VIDEO_OPENGL'.  From there, apps can create an OpenGL capable SDL_Window via the flag, SDL_WINDOW_OPENGL, and an OpenGL ES 2 context via SDL_GL_CreateContext.  The Direct3D 11.1 renderer cannot be used alongside SDL_WINDOW_OPENGL.  Only Windows 8/8.1 is supported for now.  Shaders may need to be precompiled, in some (all?) cases.
2013-11-04 19:54:29 -05:00
Sam Lantinga
ce9a47ddee Clarified that SDL_memset4 is a 32-bit assignment and fixed a compiler warning 2013-11-03 09:42:23 -08:00
Philipp Wiesemann
badb94560e Changed parameter name for gesture template save functions from "src" to "dst". 2013-11-02 12:07:21 +01:00
David Ludwig
42298bffe6 WinRT: spelling fix in SDL_hints.h 2013-10-27 23:19:35 -04:00
David Ludwig
529fcd3ee3 WinRT: merged with SDL 2.0.1 codebase 2013-10-27 21:26:46 -04:00
David Ludwig
be91d7d487 WinRT: made the Direct3D 11.x 'Debug Layer' be enable-able in any app via a hint
To enable the Debug Layer, set the hint, SDL_HINT_RENDER_DIRECT3D11_DEBUG to '1'.

The Debug Layer will be turned off by default, both in Release and Debug builds (of SDL).
2013-10-25 20:31:43 -04:00
Sam Lantinga
133a4d89f8 SDL 2.0.0 defined __inline__ and some code relies on it now. 2013-10-22 21:53:58 -07:00
Sam Lantinga
803ea95a12 Better fix for bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Jānis Rūcis

Reopening as compilation with ANSI C throws lots of unnecessary warnings, both using MinGW and using Linux GCC. (BTW, what happened? MinGW is broken to all hell. sdl2-config does not even link SDLMain anymore?)

I think this may have been lost somewhere, so again: GCC supports inlining via __inline__ in all known versions of GCC, regardless of the C standard in use. Please don't assume that __STRICT_ANSI__ implies no inlining support.
2013-10-21 02:32:34 -07:00
Sam Lantinga
e7b498cf26 Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings
Andreas Ertelt

The problem in question is caused by changeset 7771 (http://hg.libsdl.org/SDL/rev/4434498bf4b9 / https://bugzilla.libsdl.org/show_bug.cgi?id=2121)

The redefinition of __inline__ (introduced by the addition of begin_code.h:128's "|| __STRICT_ANSI__") results in mingw's gcc throwing multiple

   warning: always_inline function might not be inlinable [-Wattributes]

as well as a whole bunch of redefinitions of mingw internals which break linking of projects including the SDL2 headers.
2013-10-20 21:56:15 -07:00
Sam Lantinga
ee2991652c Added a macro SDL_TICKS_PASSED() to correctly compare two 32-bit tick values.
Went through the code and used the macro and fixed a couple places that were using incorrect timestamp comparisons.
2013-10-20 20:42:55 -07:00
Sam Lantinga
42b4cbb371 Added __WINDOWS__ to reflect both 32 and 64-bit windows platforms 2013-10-20 20:41:30 -07:00
Ryan C. Gordon
a8429a56ac Added SDL_GL_FRAMEBUFFER_SRGB_CAPABLE (thanks, David!).
Fixes Bugzilla #1985.
2013-10-20 21:18:05 -04:00
Sam Lantinga
5e83bc34c1 Added an API to get the amount of system RAM 2013-10-17 11:32:56 -07:00
Sam Lantinga
15cb545eb3 Fixed function feature test for Visual Studio 2012
norfanin

Fixes the version check for some functions that are only present with the MSVC 2013 CRT libraries.

I did my testing wrong and failed to see that 2012 doesn't have these functions. Microsoft implemented them in their upcoming 2013 version, though. The attached patch changes it to the check for the next version.

I also removed the HAVE_ITOA because that would require linking with oldnames.lib and it's easier to just let the SDL implementation take over.
2013-10-13 19:51:58 -07:00
Sam Lantinga
6fca598f55 Updated SDL to version 2.0.1 2013-10-10 21:50:25 -07:00
Gabriel Jacobo
8eae84fcf7 Adds gl_profile_mask to test framework, uses it in testgles 2013-10-10 00:49:57 -03:00
Gabriel Jacobo
4a1785a9ea SDL_TEXTINPUT support for EVDEV 2013-10-03 10:28:10 -03:00
David Ludwig
4dd121471c WinRT: unified the two, public, app-init functions
This function, SDL_WinRTRunApp, can be used to help launch either XAML or non-XAML/Direct3D-only based apps.
2013-09-22 12:26:53 -04: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
77688b3323 WinRT: more renaming of "windowsrt" to "winrt" 2013-09-04 19:55:45 -04:00
David Ludwig
93507125de WinRT: experimental and preliminary support for XAML-based overlays on Windows 8/RT
The XAML support here is still rudimentary.  Bugs do exist.  You've been warned.

XAML support in Windows Phone 8 is not yet available (in SDL/WinRT).
2013-08-27 21:21:09 -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
3f511d900f WinRT: made sure SDL_main gets used in the latest SDL 2.0.0 based code 2013-08-13 20:28:10 -04:00
David Ludwig
1ae5d8dea3 WinRT: build fixes and additional WinRT-related integrations with SDL 2.0.0 2013-08-13 20:09:52 -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
Philipp Wiesemann
07d62e2d9c Removed SDL_HAPTIC_SQUARE from comments in header to prevent doxygen confusion. 2013-08-10 23:14:20 +02:00
Ryan C. Gordon
2fbbecf909 Replaced SDL_HAPTIC_SQUARE with SDL_HAPTIC_LEFTRIGHT.
We needed a bit, so we're hoping no one needs this effect, especially when
it's fairly close to SDL_HAPTIC_SINE, we hope.

SDL_HAPTIC_LEFTRIGHT maps to XInput's functionality, so this removes the SINE
code for the XInput driver to keep things clean.

This also makes the simplified Rumble API use SDL_HAPTIC_LEFTRIGHT if
SDL_HAPTIC_SINE isn't available, to keep XInput working.

When we break the ABI, and can extend the supported capabilities field from
a Uint16, we'll add SDL_HAPTIC_SQUARE back in.

This patch is based on work by Ethan Lee.
2013-08-10 13:38:09 -04:00
Ryan C. Gordon
67a0b6551b Fixed some typos in the headers. 2013-08-10 13:20:45 -04:00
Sam Lantinga
c1a94e232c Fixed whitespace 2013-08-08 12:20:22 -07:00
Sam Lantinga
d683eadde5 The return value of SDL_MostSignificantBitIndex32(0) is defined as -1. 2013-08-07 16:32:51 -07:00
Ryan C. Gordon
77b4978afb Removed function signature that doesn't actually exist yet. 2013-08-06 18:23:46 -07:00
Ryan C. Gordon
6282a112e5 Removed anisotropic option from SDL_HINT_RENDER_SCALE_QUALITY.
Anisotropic filtering is meant to be used for textures at a stark
 angle, not perpendicular to the camera.
2013-08-06 00:23:04 -04:00
Sam Lantinga
a804c33317 Fixed stack smashing crash when using the GCC compiled DLL with Visual Studio. 2013-07-29 23:28:25 -07:00
Sam Lantinga
1d3d9d10fb Added documentation saying the render API isn't for multi-threading. 2013-07-28 11:24:16 -07:00
Ryan C. Gordon
8ee90e400d Fixed return value documentation for SDL_HapticUpdateEffect().
It was a cut-and-paste error from SDL_HapticNewEffect(), right above it.
2013-07-27 13:18:54 -04:00
Sam Lantinga
7fcffeefe0 Fixed bug 1983 - SDL_thread.h broken under MinGW crosscompiling environment
q66

after updating SDL2 to the latest RC I'm unable to build my game engine under mingw crosscompiling environment for Windows (32bit, hosted on freebsd 64bit).

The error is in SDL_thread.h with messages like this: http://codepad.org/jEQXd3Yq

The problem is, while _beginthreadex return type is correctly mapped to uintptr_t (as specified by Microsoft), the return type under mingw is unsigned long int (same size, different signature), resulting in the error above.

The reason it didn't error before is this: http://codepad.org/8FAbKAxz

You can see the _beginthreadex case is only used without HAVE_LIBC defined; at one point though, SDL_config_windows.h was changed like this:

-/* Enabled for SDL 1.2 (binary compatibility) */
-#define HAVE_LIBC     1
+/* This is disabled by default to avoid C runtime dependencies and manifest requirements */

resulting in these errors.
2013-07-27 03:44:03 -07:00
Jørgen P. Tjernø
e1bbdec6b8 Mac: Codify SDK and OS requirements, and clean up.
This #errors if you're using an SDK or deployment target that is less
than 10.6 and 10.5, respectively, and cleans up uses of
MAC_OS_X_VERSION_MIN_REQUIRED and MAC_OS_X_VERSION_MAX_ALLOWED according
to those requirements.
2013-07-23 17:38:59 -07:00
Sam Lantinga
4862c1fc30 Updated blend semantics so blending uses the following formula:
dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
    dstA = srcA + (dstA * (1-srcA))
This allows proper compositing semantics without requiring premultiplied alpha.

Needs full unit test coverage and bug fixes!
2013-07-23 08:06:49 -07:00
Sam Lantinga
ca9a19ea4c Fixed building with cygwin
Note that building with cygwin gcc results in a DLL that depends on cygwin1.dll
2013-07-21 23:01:01 -07:00
Ryan C. Gordon
ee3cbb1fa6 Fixed some compiler warnings that Visual Studio reported. 2013-07-20 19:51:51 -04:00
Philipp Wiesemann
5b2d7ee0c6 Changed documentation comment for SDL_CreateShapedWindow().
See bug #1667.
2013-07-20 21:55:15 +02:00
Jørgen P. Tjernø
c96b5c574e Fix #1667: Docs about SDL_CreateWindow and flags.
Updates the docs to say you can use SDL_WINDOW_HIDDEN, instead of (the ignored)
SDL_WINDOW_SHOWN.
2013-07-14 15:46:43 -07:00
Sam Lantinga
8ab710e751 Fixed code example for SDL_GetWindowWMInfo() 2013-07-14 11:57:01 -07:00
Sam Lantinga
7bab7a4662 Fixed bug 2121 - GCC throws error on SDL_FORCE_INLINE when compiling with -ansi 2013-09-30 22:35:32 -07:00
Sam Lantinga
3795e34c5a Fixed bug 2119 - compiler warnings (-pedantic) SDL_video.h:111:42 2013-09-30 21:57:03 -07:00
Sam Lantinga
c049a88aca Call AddRef() on the device so it doesn't accidentally get released from underneath the caller. 2013-09-28 14:07:17 -07:00
Sam Lantinga
ac2735a4a4 Make it clear we're just returning a D3D9 device, allowing for new functions to get other D3D versions 2013-09-28 14:07:14 -07:00
Sam Lantinga
c045f564ad Added a hint to create the D3D device in thread-safe mode: SDL_HINT_RENDER_DIRECT3D_THREADSAFE 2013-09-28 14:07:08 -07:00
Sam Lantinga
4eac5bc7be Added platform specific call: SDL_RenderGetD3DDevice() 2013-09-28 14:07:05 -07:00
Sam Lantinga
b7d5ed3b6f Added optimized YUV texture upload path with SDL_UpdateYUVTexture() 2013-09-28 14:06:47 -07:00
Sam Lantinga
4bfb868d6f Fixed bug 1820 - building SDL as a static library with static runtime doesn't compile/link with visual studio
norfanin

Adds a condition so only the MSVC 2012 compiler defines the macros for the functions of its version.

Attaching a patch that adds a condition so that the HAVE_X supported by MSVC 2012 only get defined with that compiler. MSVC 2008 and 2010 will then build without any modification to the SDL source code.

Also moved HAVE_M_PI to a separate check. The Microsoft headers require _USE_MATH_DEFINES to be defined before they define the constants.
2013-09-28 10:30:51 -07:00
Gabriel Jacobo
dd33e35895 Raspberry Pi support (also unified UDEV and EVDEV support) 2013-09-28 13:28:19 -03:00
Philipp Wiesemann
5d90db278a Fixed doxygen warning. 2013-09-28 12:55:32 +02:00
Sam Lantinga
b93ff3b6ef Fixed the name of the environment variable to match the name of the hint. 2013-09-27 23:19:22 -07:00
Edward Rudd
fab88c0df2 add in High DPI support (aka Retina)
- based on Jørgen's patch with a few bug fixes
2013-09-20 13:43:00 -04:00
Sam Lantinga
c1a125c267 Added SDL_Direct3D9GetAdapterIndex(), which returns the adapter index you would pass into CreateDevice to get your device on the right monitor in full screen mode. This fixes the default adapter in SDL_render_d3d.c, which means that tests will work fullscreen off the main monitor now.
CR: Sam
2013-09-13 17:42:46 -07:00
Ryan C. Gordon
4ec784c0d5 Workaround for compiling with /W4 warnings on Visual C++. 2013-09-07 13:57:20 -04:00
Sam Lantinga
32810bdaa3 Fixed bug 2081 - Add name to SDL_Point structure
Dmitry Marakasov

Unlike SDL_Rect (typedef struct SDL_Rect {} SDL_Rect), SDL_Point (typedef struct {} SDL_Point) structure is unnamed. This feels inconsistent and makes it impossible to use forward declaration for SDL_Point, having to include whole SDL_rect.h instead.
2013-09-05 07:02:27 -07:00
Ryan C. Gordon
4e510b3a87 The SDL_PixelFormat* passed to SDL_ConvertSurface() should be const. 2013-09-04 23:40:11 -04:00
Edward Rudd
c95bbc9ce2 make the examples in the doc comments match the actual output of the SDL_GetPrefPath function 2013-08-24 09:43:14 -04:00
Gabriel Jacobo
0f8f61d79d Separate EGL / GL ES detection in CMake 2013-08-22 14:56:07 -03:00
Ryan C. Gordon
6832f3e1de Added SDL_VIDEO_OPENGL_ES2 to the SDL_config.h templates (Thanks, Kerim!). 2013-08-22 13:00:05 -04:00
Gabriel Jacobo
8515791f86 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
871473e032 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Ryan C. Gordon
8fe1cf47f2 Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Ryan C. Gordon
c3f2a8dbda Added SDL_DEPRECATED #define. 2013-08-20 14:21:35 -04:00
Ryan C. Gordon
0669807485 Added SDL_assert_always (never disabled). 2013-08-20 14:17:48 -04:00
Gabriel Jacobo
f93c78450b More non C89 compliant comments 2013-08-20 20:34:40 -03:00
Gabriel Jacobo
84f07d804a Fixes bug #2037, common EGL code for Android and X11 2013-08-19 16:29:46 -03:00
Sam Lantinga
8498376baa Fixed warnings building with gcc 2 and gcc 4 on Haiku 2013-08-18 23:18:11 -07:00
Philipp Wiesemann
7c8b4cdc44 Replaced introduction in header file with more recent version from README.txt. 2013-08-18 11:15:30 +02:00
Philipp Wiesemann
69fc4812b7 Corrected file names in header file comments. 2013-08-18 11:12:46 +02:00
Philipp Wiesemann
e0130f52c4 Changed some documentation comments in header files to be used by doxygen. 2013-08-18 11:08:52 +02:00
Sam Lantinga
8f2f5f59d2 Added a hint to control the Windows timer resolution: SDL_HINT_TIMER_RESOLUTION
Added an API to watch hint changes: SDL_AddHintCallback(), SDL_DelHintCallback()
You can now dynamically set the joystick background event hint.
2013-07-13 03:13:41 -07:00
Dimitris Zenios
9637ceba41 Fixed gcc warnings for apps using SDL headers with -Wstrict-prototypes flag. 2013-07-12 09:55:58 +03:00
Sam Lantinga
88d269ecd7 Fixed Azamat's patch for SIZEOF_VOIDP in SDL_config.h.in 2013-07-11 23:16:47 -07:00
Azamat H. Hackimov
214b051e50 Define universal answer of SIZEOF_VOIDP for 32/64-bit architectures.
This commit makes SDL_config.h universal, so it can be used with mixed
32 and 64 enviroment simultaneously.
2013-06-05 12:28:53 +06:00
Sam Lantinga
2172f538cc Fixed bug 1946 - OpenGL contexts in threads
The SDL OpenGL context code is now properly thread aware.  There are two new functions which return the current OpenGL window and context for the current thread.

There are still places in the cocoa driver where the OpenGL context needs to be updated when the view changes.  These will need a different solution and still use the last globally set context to avoid changing behavior.
2013-07-11 22:59:20 -07:00
Sam Lantinga
7889fcdc7d Added PowerPC and ARM versions of the memory barrier functions. 2013-07-10 20:17:20 -07:00
Sam Lantinga
f5306d72d0 Added release/acquire memory barriers to the atomic API
* Added a destructor to clean up TLS memory at thread shutdown
* Refactored the TLS code to have platform independent code and a small platform dependent core with a fallback to generic code if platform dependent functions fail.
* Fixed recursion issues with SDL_GetErrBuf()
2013-07-10 18:31:17 -07:00
Sam Lantinga
9c0dea8e15 Implemented an API for thread-local storage: SDL_TLSCreate(), SDL_TLSSet(), SDL_TLSGet() 2013-07-10 02:32:04 -07:00
Ryan C. Gordon
910e8a8155 Backout hg changset 898992405fa7; lots of things still use SDL_types.h. :/
Will remove this again at some point in the future, though.
2013-07-09 11:57:32 -04:00
Sam Lantinga
7be0e70524 Made the SDL_memset4() comment even clearer so we don't accidentally replace it with memset() in the future. 2013-07-09 08:01:40 -07:00
Sam Lantinga
09997d0e9f Backed out commit 898992405fa7 because memset() does a byte fill and SDL_memset4() does a uint32 fill and this change breaks SDL_FillRect() 2013-07-09 07:13:58 -07:00
Ryan C. Gordon
173b1e9280 Removed deprecated SDL_types.h header.
Fixes Bugzilla #1945.
2013-07-08 23:37:00 -04:00
Ryan C. Gordon
fca053548a Replaced SDL_memset4() implementation with a call to SDL_memset().
The implementation was slower than the C runtime on Mac OS X, Linux, and
 Windows...quite a bit slower when using the C fallback instead of the inline
 asm, too.

Fixes Bugzilla #1755.
2013-07-08 23:22:36 -04:00
Philipp Wiesemann
6f27bb0714 Corrected name of constant in header file comment. 2013-07-07 16:15:21 +02:00
Ryan C. Gordon
6174013522 Added an SDL2 OpenBSD sndio(7) audio target. 2013-07-07 02:03:07 -04:00
Sam Lantinga
8425cf5d1a Fixed bug 1911 - enable HAVE_GCC_ATOMICS for android platform 2013-07-06 12:39:56 -07:00
Sam Lantinga
e6a7f560a0 Make it possible to use SDL events separately from the video subsystem. 2013-07-06 12:28:57 -07:00
Sam Lantinga
69bede6d35 Removed the inline functions from SDL_stdinc.h
Having the SDL functions inline is causing build issues, and in the case of malloc(), etc. causing malloc/free mismatches, if the application build environment differs from the SDL build environment.

In the interest of safety and consistency, the functions will always be in the SDL library and will only be redirected to the C library there, if they are available.

See the following threads on the SDL mailing list for the gruesome details:
* SDL_stdinc.h inlines problematic when application not compiled in exact same feature environment
* Error compiling program against SDL2 with -std=c++11 g++ flag
2013-07-05 23:57:19 -07:00
Sam Lantinga
10f2d9ded3 Added SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS to the documentation for the joystick and game controller APIs 2013-07-03 12:31:40 -07:00
Sam Lantinga
822fa46bfe Not using SDLmain on Windows is just fine, don't fail the initialization if the program implements WinMain() and then doesn't call SDL_SetMainReady().
This broke Steam's Big Picture game controller support.

I also added some more documentation so people know why main() is overridden on various platforms.
2013-06-28 22:44:49 -07:00
Jørgen P. Tjernø
ac9d81df00 Remove / update references to 1.2. 2013-06-27 17:07:24 -07:00
Sam Lantinga
13787068f8 Fixed bug 1916 - SDL_Keysym contains a deprecated field for unicode which may be removed.
Philipp Wiesemann

SDL_Keysym contains a deprecated field for unicode which may be removed for SDL 2.0 release.

As far as I can tell the field is not set on all "major" platforms and therefore will not be useful for most users. Its existence in a public header therefore becomes (in my opinion) only confusing.
2013-06-18 00:39:47 -07:00
Philipp Wiesemann
39a52070c6 Changed comment to be used by doxygen. 2013-06-16 12:00:54 +02:00
Sam Lantinga
f35af890ee Allow users to define SDL_STDINC_NO_INLINES if they don't want the inline functions defined.
This is useful, for example, if the standard config defines HAVE_SETENV but you're building with C99 that doesn't include that feature.
2013-06-13 22:30:02 -07:00
Sam Lantinga
d8b6e04ab1 Fixed SDL building with the minimal configuration 2013-06-13 22:10:10 -07:00
Philipp Wiesemann
1e57fbb3ea Updated names of README files in source comments. 2013-06-09 11:58:31 +02: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
6a0ed22cdc Added some extra protection to notify the developer if they haven't initialized the application properly.
This will help reduce issues like that reported in bug 1819:

Wouter van Oortmerssen 2013-04-23 20:12:07 EDT
#0  0x01d1e881 in __HALT ()
#1  0x01c58971 in _CFRuntimeCreateInstance ()
#2  0x02e4acc1 in GSFontCreateWithName ()
#3  0x00adc0e1 in UINewFont ()
#4  0x00adc24c in +[UIFont systemFontOfSize:traits:] ()
#5  0x00adc298 in +[UIFont systemFontOfSize:] ()
#6  0x009fb5d9 in +[UITextFieldLabel defaultFont] ()
#7  0x00a8ccd5 in -[UILabel _commonInit] ()
#8  0x00a8ce14 in -[UILabel initWithFrame:] ()
#9  0x00a052eb in -[UITextField createTextLabelWithTextColor:] ()
#10 0x009fbede in -[UITextField initWithFrame:] ()
#11 0x00152ead in -[SDL_uikitview initializeKeyboard] at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/uikit/SDL_uikitview.m:208
#12 0x0015290c in -[SDL_uikitview initWithFrame:] at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/uikit/SDL_uikitview.m:50
#13 0x00153b5b in -[SDL_uikitopenglview initWithFrame:scale:retainBacking:rBits:gBits:bBits:aBits:depthBits:stencilBits:majorVersion:] at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/uikit/SDL_uikitopenglview.m:53
#14 0x001524ff in UIKit_GL_CreateContext at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/uikit/SDL_uikitopengles.m:114
#15 0x0015078f in SDL_GL_CreateContext at /Users/aardappel/lobster/external/SDL-2.0.0-7046/Xcode-iOS/SDL/../../src/video/SDL_video.c:2666
#16 0x000d8c5c in SDLInit(char const*, vec<int, 2>&) at /Users/aardappel/lobster/dev/xcode/lobster/../../src/sdlsystem.cpp:193
2013-06-05 21:23:59 -07:00
Jørgen P. Tjernø
3bff17cb2e Joystick: Only send joy events when focused.
This changes makes it so that you only receive joystick (and implicitly
gamecontroller) input events when your application has keyboard focus.
If you'd like to still receive events when your application is in the
background, set the SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint to "1".

This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1892
2013-06-05 15:11:38 -07:00
Philipp Wiesemann
6e78c6aff1 Fixed doxygen warnings and corrected documentation in header files. 2013-06-05 23:33:15 +02:00
Azamat H. Hackimov
3645242ba8 Fix compilation with libX11 >= 1.5.99.902.
These changes fixes bug #1769 for SDL2
(http://bugzilla.libsdl.org/show_bug.cgi?id=1769).
2013-06-02 20:20:18 +06:00
Philipp Wiesemann
d6dbb779f0 Changed documentation in header because LocalReferenceHolder not public API. 2013-06-02 14:27:54 +02:00
Sam Lantinga
b0b6b803fc Fixed bug 1882 - SDL_GetKeyboardState should return const.
Yuri K. Schlesner

The array returned by SDL_GetKeyboardState is also used internally by SDL to keep track of pressed/released keys and must not be modified, lest weird behaviour occurs. Because of this I believe it's return type should be changed to return a const pointer, which will provide a code indication of that fact.
2013-06-02 01:09:12 -07:00
Sam Lantinga
028c19b92b When the window is resized, the viewport is automatically reset.
This resolves lots of confusion around resizable windows.  Most people don't expect a viewport to be implicitly set when the renderer is created and then not to be reset to the window size if the window is resized.

Added common test command line parameters --logical WxH and --scale N to test the render logical size and scaling APIs.
2013-05-29 03:22:19 -07:00
Sam Lantinga
23f33cb76c Fixed bug 1622 - SDL_RenderSetViewport with empty SDL_Rect raises wrong error for OpenGL rendering backend
It's now legal to set an empty viewport rect - it will prevent any rendering.

Also added an API to query the output size: SDL_GetRendererOutputSize()
2013-05-29 03:07:55 -07:00
Sam Lantinga
85f91bdb30 Added a comment to say why C runtime is off by default 2013-05-26 16:08:15 -07:00
Sam Lantinga
c5701fe360 Don't use the C runtime library on Windows, to avoid C runtime dependencies and manifest issues. 2013-05-26 15:50:20 -07:00
Sam Lantinga
1e9722a016 Don't assume the XAudio2 APIs will never be available 2013-05-26 11:39:19 -07:00
Philipp Wiesemann
d06a0935e6 Corrected documentation errors in header file. 2013-05-26 12:30:52 +02:00
Sam Lantinga
d464d16a8f Fixed Haiku build issue with missing extension support.
The visibility attribute warnings in Haiku gl.h can be fixed by editing gl.h and changing the line:
#elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
to
#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))

as described in: http://dev.haiku-os.org/ticket/8882
2013-05-21 22:48:50 -07:00
Ryan C. Gordon
723af2b82a Backed out changeset b69dfd56e1b0
This was clearly not the right fix.
2013-05-21 23:35:45 -04:00
Ryan C. Gordon
886e159e92 Attempt to fix Haiku buildbot (and other systems with an old glext.h). 2013-05-21 23:13:52 -04:00
Sam Lantinga
9f6a52c28a Fixed bug 1856 - (Patch) More bits for SDL_MouseMotionEvent.state
Gerry JJ

The state bitmask in SDL_MouseMotionEvent is stored in an Uint8. Unfortunately this doesn't actually have room for 8 buttons because SDL skips 4 button indices after the third mouse button (at least here on Linux x86-64, probably related to wheel handling?), so it's really just enough to track 4 buttons. For example, on a Logitech MX310 mouse I've got, even though the mouse has 6 buttons total, the left and right side buttons and extra middle button have indexes 8, 9 and 10, and the last two won't fit in the 8 bit button state.

The source of the button state (in SDL_Mouse) is already 32-bit, and the state field in SDL_MouseMotionEvent is 32-bit aligned and followed by three 8-bit padding fields. So simply changing the SDL_MouseMotionEvent state to an Uint32 and removing the padding fields fixes this, and I think it should be binary compatible, at least for little endian.
2013-05-20 23:57:10 -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
1063a72829 Fixed bug 1837 - Use error extension instead of glGetError()
Implemented support for GL_ARB_debug_output, but was unable to test it on Mac OS X.
2013-05-19 22:28:10 -07:00
David Ludwig
6356c76c2f WinRT: added preliminary joystick / game controller support (minus hotplugging) 2013-05-19 23:30:34 -04:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
3beb70c4bc Added mobile application events, with implementations for iOS and Android 2013-05-18 12:48:50 -07:00
Andreas Schiffler
d99b036e08 Update test harness to handle test return codes; fix comment format in harness; update Main test suite to handle globally disabled features 2013-05-18 09:35:09 -07:00
Philipp Wiesemann
27e1a7ca41 Fixed Doxygen warnings. 2013-05-18 14:48:19 +02:00
Ryan C. Gordon
3928468bfa Made SDL_RectEmpty and SDL_RectEquals macros into SDL_FORCE_INLINE functions.
Fixes compiler warnings for things like this...

  if (SDL_RectEmpty(&rect)) {}

...where the macro turned into "if ( (!(&rect)) && etc )" which some compilers
thought might be a programmer mistake, as "&rect" is always "true".
2013-05-16 12:16:12 -04:00
Philipp Wiesemann
f9a69af2f0 Fixed Doxygen warnings. 2013-05-15 22:00:28 +02:00
Philipp Wiesemann
8da0b7d301 Corrected spelling in header file. 2013-05-13 23:00:50 +02:00
Philipp Wiesemann
d1cc72dd52 Fixed bug 1845 - SDL_GetNumTouchDevices() has incorrect prototype
nfxjfg

SDL_touch.h:63:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]

Is:

extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices();

Should be:

extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
2013-05-12 13:42:20 +02:00
Philipp Wiesemann
f38eef4c83 Fixed bug 1843 - SDL_RenderClear prototype doxygen missing
Martin Gerhardy

SDL_RenderClear prototype misses documentation for the return value
2013-05-12 13:25:34 +02:00
Sam Lantinga
7253832be1 First pass on SDL render clip rect functionality 2013-05-04 04:46:00 -07:00
Philipp Wiesemann
8708a0a38d Corrected spelling in header files. 2013-04-27 17:52:58 +02:00
Philipp Wiesemann
a4858757cc Corrected spelling header file comments. 2013-04-27 14:33:27 +02:00
Philipp Wiesemann
6868b550db Corrected comment in header file. 2013-04-27 13:42:56 +02:00
Jørgen P. Tjernø
01c74a11b7 Add SDL_GetDefaultCursor.
This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1798
Thanks to Alex Szpakowski for suggestion & patch.
2013-04-24 10:42:44 -07:00
Gabriel Jacobo
d1ec7f2e3c Moved warning about SDL_AndroidGetActivity to SDL_system.h 2013-04-23 16:44:54 -03:00
David Ludwig
18180bc951 WinRT: removed the "generic" + C++/CX hack-fix, now that a better fix is in official-SDL 2013-04-21 12:49:15 -04:00
David Ludwig
6bf31495f9 WinRT: merged with latest, official, SDL 2.x sources 2013-04-21 12:38:44 -04:00
David Ludwig
95a3bba282 future-proofing for Microsoft's C++/CX extensions, whereby "generic" is a reserved keyword 2013-04-20 23:05:08 -04: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
Ryan C. Gordon
7cdcd5bebb Cleaned up the const_cast mess a little. 2013-04-16 01:38:08 -04:00
Ryan C. Gordon
98dc9306b5 Removed C++-style single-line comments from a public header (thanks, Martin!).
Fixes Bugzilla #1803.
2013-04-16 01:05:32 -04:00
Ryan C. Gordon
006f31e2ec Make the new SDL_RWops::hidden::unknown::data2 field a void*, not an int. 2013-04-14 18:05:14 -04:00
David Ludwig
f9531484c0 WinRT: hack-fixed C++/CX compile errors regarding the 'generic' field in SDL_Event, which conflicts with a C++/CX keyword 2013-04-14 11:45:01 -04:00
David Ludwig
49820874a9 WinRT: merged with latest, official, SDL 2.x sources (at rev. bea100d73d13) 2013-04-14 11:42:55 -04:00
Ryan C. Gordon
1e6e7727c6 Added a data2 field to the SDL_RWops::hidden::unknown.
This shouldn't change the ABI, since this struct had space left in the union.
2013-04-13 20:43:32 -04:00
Ryan C. Gordon
a5ca62ea98 Fixed a typo (thanks, Ethan!). 2013-04-10 22:18:10 -04:00
Ryan C. Gordon
f77b979436 More const_cast fixes for C++ apps using the public headers (thanks, Martin!). 2013-04-08 18:37:50 -04:00
Ryan C. Gordon
76435d933b Corrected some stdinc inline functions (thanks, Martin!).
qsort() returns void, so remove the "return" keyword, plus some C++
 const_casting magic.

 Fixes Bugzilla #1785.
2013-04-04 11:35:22 -04:00
Ryan C. Gordon
7635069643 Fixed compiler warnings in Mac Xcode builds. 2013-04-03 11:58:04 -04:00
Ryan C. Gordon
f3c21ea99e Another attempt at fixing compiler warnings for SDLTest_SurfaceImage_t. 2013-04-03 11:49:25 -04:00
Ryan C. Gordon
09c6b9cdfb Possibly fix compiler warnings, simplify SDLTest_SurfaceImage_t definition. 2013-04-03 11:38:05 -04:00
Sam Lantinga
d7bd3b7307 Fixed bug 1782 - SDL_opengl.h header disabled on FreeBSD
q66

The SDL_opengl.h header contains this:

#ifdef __FreeBSD__  /* !!! FIXME: temp compiler warning fix... */
#define NO_SDL_GLEXT 1
#endif

However, I can't seem to find what kind of compiler warning it was and it makes it unusable to use on FreeBSD. If I comment out these lines on my machine, everything works fine - I use FreeBSD 9-STABLE (x86_64, gcc and clang both, the same in a x86 chroot). All I could find is that this was causing an error on FreeBSD 8, but I can't test that on my machine (maybe if I set up some FreeBSD 8 chroot).

I set up a 8.2 chroot and investigated the problem. Apparently this issue was fixed in Mesa 7.6 (and in Git, June 4 2009, but it didn't get into 7.5). By the time those lines were added, FreeBSD contained the libGL port version 7.4.4, which suffered from the issue, but on April 2012 the version was updated to 7.6, which is available for FreeBSD 8 and FreeBSD 9 alike, which means those three lines should be safe to remove (it'll work fine for everyone with sufficiently up to date ports).
2013-04-01 23:15:21 -07:00
David Ludwig
44e81071eb WinRT: made WinRT path retrieval be available in both UCS-2 and UTF-8 flavors 2013-04-01 21:33:06 -04:00
Ryan C. Gordon
16cdc59bab Make SDL_SetError and friends unconditionally return -1.
This lets us change things like this...

    if (Failed) {
        SDL_SetError("We failed");
        return -1;
    }

...into this...

    if (Failed) {
        return SDL_SetError("We failed");
    }


 Fixes Bugzilla #1778.
2013-03-31 12:48:50 -04:00
Ryan C. Gordon
171ad2ddcd Corrected function signature on SDL_strtod_inline() (thanks, Axel!).
Fixes Bugzilla #1774.
2013-03-29 21:29:57 -04:00
Ryan C. Gordon
cf94d2de94 Don't use __builtin_clz() on gcc2. (thanks, Axel!)
Fixes Bugzilla #1771.
2013-03-29 21:16:30 -04:00
Ryan C. Gordon
a9eb1f14ea Fixed compiler warnings with SDL_FORCE_INLINE on gcc2. (Thanks, Axel!)
Fixes Bugzilla #1770.
2013-03-29 21:13:16 -04:00
Sam Lantinga
4d92e1780f We're using the alpha component of the palette entries, let's name it appropriately. 2013-03-24 09:56:45 -07:00
Sam Lantinga
ba643a7daa Updated the license listed in the header, fixing bug 1768 2013-03-23 13:03:36 -07:00
Sam Lantinga
20218f7e77 Fixed bug 1764 - Integer Precision Loss During Compilation
Phil Sampson

/Library/Frameworks/SDL2.framework/Headers/SDL_stdinc.h:345:28: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int'
2013-03-19 22:02:34 -07:00
Sam Lantinga
4b50e8b609 Fixed bug 1763 - Constify SDL_UpdateWindowSurfaceRects()
Ryan C. Gordon

With this function...
   SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects, int numrects);
...is there any reason rects isn't "const SDL_Rect *" ?
2013-03-19 21:53:33 -07:00
Sam Lantinga
96627b3e6b The platform define for the PSP is __PSP__ 2013-03-17 09:45:40 -07:00
Sam Lantinga
f0af9a3e70 Removed Nintendo DS support since nobody has volunteered to maintain it for over a year. 2013-03-17 09:44:58 -07:00
Captain Lex
a18bccd5f3 Add PSP support 2013-03-17 20:07:02 +08:00
Sam Lantinga
562dfede27 Fixed more const issues with C++ 2013-03-16 11:00:04 -07:00
Sam Lantinga
561c6ca3d6 Fixed const correctness issue with C++, and fixed building SDL_memcpy4 with 32-bit gcc. 2013-03-15 11:56:28 -07:00
Sam Lantinga
ad801e12f4 Clarified inline function documentation, removed obsolete Metrowerks compiler directive. 2013-03-14 23:10:51 -07:00
Ryan C. Gordon
28a15d3609 Replace all the "static __inline__" functions with SDL_FORCE_INLINE. 2013-03-15 01:09:19 -04:00
Ryan C. Gordon
1fa34e72be Improvements to stdlib.
All SDL_* functions are always available as real symbols, so you can always
link against them as a stable ABI. By default, however, all the things that
might have dithered down to macros in your application are now force-inlined,
to give you the same effect as before and theoretically better performance,
but still solve the classic macro problems.

Elsewhere, we provide real functions for these things that simply wrap the
inline functions, in case one needs to have a real function available.

Also: this exposed bugs: SDL_abs() does something different if you had the
macro vs the libc function, SDL_memcpy() returns a void* in the function
but not the macro, etc.
2013-03-15 01:01:20 -04:00
Ryan C. Gordon
fae7c9cf7d Added an SDL_FORCE_INLINE macro. 2013-03-15 01:02:30 -04:00
Andreas Schiffler
157d9c6b00 Fix bug 122 - SDL_RWops bug fixes: set RWops.type field, add input validation, add test coverage 2013-03-13 08:35:03 -07:00
Andreas Schiffler
c6e3903e5b Fix bug 1560 - SDL_RWFromConstMem write operation returns -1 but should return 0. 2013-03-12 09:10:37 -07:00
Ryan C. Gordon
e097576967 First shot at Windows XInput haptics. 2013-03-10 13:05:47 -04:00
Andreas Schiffler
449a8da224 Add parameter checking to SetWindowSize functions; add tests to video suite 2013-03-08 23:33:07 -08:00
Sam Lantinga
b6d332f3ab Updated SDL_HINT_GAMECONTROLLERCONFIG documentation to reflect that it only takes effect before init. 2013-03-08 16:27:05 -08:00
Ryan C. Gordon
ec1318bf1a Changed SDL_INIT_EVERYTHING to only request currently-known subsystems. 2013-03-08 11:38:08 -05:00
Sam Lantinga
8c502e53f0 Don't re-read the hints when opening the game controller. Instead use SDL_GameControllerAddMapping() to add hints after initialization. 2013-03-08 10:09:51 -08:00
Sam Lantinga
e4ff0d5a17 Put the real SDL_AtomicCAS() and SDL_AtomicCASPtr() symbols into the library. 2013-03-07 20:42:55 -08:00
Sam Lantinga
2952d9bf48 Changed the name of SDL_mutexP() SDL_mutexV() 2013-03-07 20:12:40 -08:00
Sam Lantinga
e04e170169 The joystick events contain a joystick instance ID, which is a signed value, with -1 being invalid. 2013-03-06 11:59:21 -08:00
Sam Lantinga
74137ce784 Removed multi-input events, since we removed the unimplemented API recently. 2013-03-06 11:59:15 -08:00
Edward Rudd
e4d41effe3 Add SDL_TryLockMutex and implementations for all platforms 2013-03-05 18:54:55 -05:00
Edward Rudd
f6e2a00b15 add hint to allow disabling the use of Xinput. 2013-03-05 18:01:59 -05:00
Edward Rudd
3e7df38c71 add new gamecontroller APIs
- add mappings after init (or even before w/o using the hint)
- get string for axis
- get string for button
- get mapping string for controller or for GUID
- new event to notify when a controller is remapped. (e.g. mapping was changed via the AddMapping method)
2013-03-05 17:59:36 -05:00
Sam Lantinga
1916ec2de3 Updated touch API
* Normalized touch coordinates as floats in the 0...1 range
* Removed unused touchpad concepts from the API
* Added API functions to get active touch devices and current finger state
2013-03-03 01:01:33 -08:00
Sam Lantinga
a2aa3983b3 Added a mouse ID to the mouse events, which set to the special value SDL_TOUCH_MOUSEID for mouse events simulated by touch input. 2013-03-02 20:44:16 -08:00
Sam Lantinga
db3cba4095 Fixed the joystick id usage in the joystick and game controller events. 2013-03-02 17:51:32 -08:00
Sam Lantinga
834cbe125f Updated the link to the USB usage page document 2013-02-28 20:01:17 -08:00
Sam Lantinga
f0bf08280b Fixed gcc pedantic warnings in public headers 2013-02-26 20:41:28 -08:00
Jørgen P. Tjernø
a387ff7086 sdl2
- fix atomic header to compile happily under msvc 6.0
2013-02-25 16:52:48 -08:00
Jørgen P. Tjernø
e2b192f98d sdl2
- change the windows scancode logic to use the scan code value in lparam rather than VK's to get a stable scancode value across different KB layouts
2013-02-25 16:52:42 -08:00
Ryan C. Gordon
3104ca4190 Added SDL_GameControllerUpdate(). 2013-02-25 01:51:21 -05:00
Ryan C. Gordon
ad75661c46 Added SDL_haptic.h to SDL.h. 2013-02-25 01:50:59 -05:00
Ryan C. Gordon
b7b7f889c5 Changed the game controller enum types to match SDL naming conventions. 2013-02-25 00:56:21 -05:00
David Ludwig
7b0ad782e6 WinRT: build fixes 2013-02-23 20:12:14 -05:00
David Ludwig
db53df0697 WinRT: merged with latest, official, SDL 2.x code 2013-02-23 20:01:46 -05:00
Sam Lantinga
d486363049 The input API was never implemented, so removing it before release. 2013-02-19 05:39:19 -08:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
2cfcf17348 Updated documentation with info about the wiki
We're no longer under construction, baby!
2013-02-14 15:56:33 -08:00
Andreas Schiffler
857ddffc40 Add tests to SDLtest suite 2013-02-13 23:10:29 -08:00
Jørgen P. Tjernø
75626eac76 New SDL_MSBIndex, updated VS projects, cleanup gamecontroller.
- Updated Visual Studio 2010 project with SDL 2.0 library names
- Don't use a 256 byte LUT, but rather <32 bytes of data on the stack.
- Cleanups in SDL_gamecontroller.h
2013-02-13 17:19:21 -08:00
Andreas Schiffler
37203106e0 Fix fuzzer random boundary functions; add tests for fuzzer 2013-02-12 22:23:42 -08:00
Jørgen P. Tjernø
29f980d205 Check bounds in SDL_IsGameController. Switch two functions to SDL_bool.
Switches SDL_GameControllerGetAttached and SDL_IsGameController to
       return SDL_bool, instead of int.
2013-02-12 17:07:21 -08:00
Jørgen P. Tjernø
e8a48ee6c0 Don't clobber refcounting in SDL_Init.
- Fixes bug 1712 by not overwriting SDL_SubsystemRefCount in SDL_Init.
       - Removes the SDL_initialized variable, and makes SDL_SubsystemRefCount
         the canonical source of truth for whether or not a subsystem has been
         initialized.
       - Refactors SDL_InitSubSystem and SDL_QuitSubSystem to use helper
         functions to manage refcount.
       - Adds automated tests for SDL_Init/Quit*.
       - Adds SDL_bits.h which contains SDL_MostSignificantBitIndex.
2013-02-12 11:47:31 -08:00
David Ludwig
e73e2ca8d9 WinRT: consolidated all WinRT path-retrieval functions into one function 2013-02-09 22:48:19 -05: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
11f36eaddb WinRT: added a function to retrieve the root path to the installed app 2013-02-03 12:49:12 -05:00
David Ludwig
2ef67300a3 WinRT: made path retrieval functions return wide-char strings 2013-02-03 12:34:34 -05:00
David Ludwig
7eb00a855c WinRT: use OS-native vsnprintf, which allows SDL_Log to format wide strings (via %ls) 2013-02-03 12:33:15 -05:00
David Ludwig
4f6ffdc590 WinRT: started refactoring Direct3D 11.1 code into a new SDL_Renderer backend 2013-02-02 19:32:44 -05:00
David Ludwig
4d3efcce33 WinRT: added platform-specific APIs to access common, writable folder paths 2013-01-22 21:45:59 -05:00
Sam Lantinga
b2bcc76cd9 Fixed building SDL under Xcode 2013-02-11 11:09:55 -08:00
Sam Lantinga
e070132e57 Fixed typo in documentation 2013-01-27 15:53:24 -08:00
Tim Angus
0057af3d90 Fix warning in SDL_keyboard.h 2013-01-17 11:54:14 +00:00
Andreas Schiffler
0720db59b2 Update SDL_InvalidParamError to take param name; add additional fuzzer function; add new tests to keyboard test suite; improve surface test suite 2013-01-12 22:58:12 -08:00
Andreas Schiffler
298c11033b Add new internal error message for invalid parameters; add validation of input rect in SDL_SetTextInputRect; add test cases for SDL_SetTextInputRect to keyboard suite 2013-01-11 20:36:39 -08:00
Gabriel Jacobo
f997d045c5 Android: Access APK files using AssetFileDescriptor 2013-01-08 09:30:53 -03:00
David Ludwig
1221e49e58 WinRT: added support for the SDL_loadso APIs, via LoadPackagedLibrary 2012-12-31 10:30:38 -05:00
David Ludwig
b2fc5e5186 WinRT: fixed XAudio2 crash bug + enabled XAudio2 backend 2012-12-30 12:57:33 -05:00
Sam Lantinga
30cf30ad23 Fixed bug 1653 - comma at the end of enum
Martin Gerhardy 2012-11-30 03:07:14 PST

SDL_gamecontroller.h:61:29: warning: comma at end of enumerator list [-pedantic]
2012-12-31 16:29:01 -08:00
Sam Lantinga
06f8fe85cf Added SDL_SetWindowMaximumSize() and SDL_GetWindowMaximumSize()
Also fixed Cocoa implementation so that it affects client area, not the whole window area.
2012-12-31 12:15:25 -08:00
Sam Lantinga
ad65f9e5a4 Added SDL_GetDisplayName(), with implementation for Mac OS X 2012-12-31 11:07:46 -08:00
Sam Lantinga
c856925d3e Renamed SDL_GetWindowDisplay() to SDL_GetWindowDisplayIndex() 2012-12-31 10:29:17 -08:00
Sam Lantinga
f425fe1358 Improvements from Alfred:
- Added new SDL_HINT_ALLOW_TOPMOST hint, when set to "0" then never set the topmost bit on a window. Useful when debugging fullscreen issues.
- fixed crash in windows joystick scanning if we failed to load the xinput dll
- added support for SDL_WINDOW_FULLSCREEN_DESKTOP under windows
- synthesize relative mouse movements if directinput fails to send relative moves, happens under virtual box.
2012-12-31 09:30:15 -08:00
Ryan C. Gordon
2d97db998b Better compiler warning fix for gcc2. 2012-12-28 20:01:41 -05:00
Ryan C. Gordon
a2d1bcb337 Fixing buildbot on Haiku.
Damn you, gcc2.
2012-12-28 18:15:02 -05:00
Ryan C. Gordon
b71c7f092b Replaced Gnome screensaver hack with D-Bus messages to org.gnome.ScreenSaver. 2012-12-28 03:46:55 -05:00
Andreas Schiffler
e00532130b Add surface test suite; minor improvements to render suite; refactor image saving into test lib compare function; fix for Haiku build 2012-12-26 22:26:44 -08:00
Andreas Schiffler
669e4e9a21 Added audio test suite; minor code cleanups in test lib 2012-12-24 14:43:57 -08:00
Sam Lantinga
cc09717698 Fixed const correctness in the test harness 2012-12-22 17:24:14 -08:00
Sam Lantinga
2269018714 Merged Andreas' changes 2012-12-22 16:52:00 -08:00
Andreas Schiffler
add645da12 Test lib updates: updated harness to support filtering, added surface comparer, updated interface to test images; added Render test suite from GSOC project 2012-12-22 16:06:55 -08:00
Sam Lantinga
6265362318 The latest version of MinGW-w64 has the necessary headers and libraries: http://mingw-w64.sourceforge.net/ 2012-12-22 11:23:18 -08:00
Andreas Schiffler
ead556e41f Add image data definitions (for render tests) to test lib 2012-12-20 08:50:36 -08:00
Ryan C. Gordon
7007dc6ac2 Patched to compile when SDL_ASSERT_LEVEL is zero. 2012-12-18 06:35:49 -05:00
David Ludwig
1d8ca8fb11 WinRT: merged with the latest official SDL source 2012-12-16 22:02:01 -05:00
Andreas Schiffler
f9c94c75e8 Refactor/fix test lib harness, assert and log component; add harness driver; port platform suite from GSOC code 2012-12-14 23:05:34 -08:00
Sam Lantinga
26cf48ded8 Improvements from Alfred:
- Add new SDL_WINDOW_FULLSCREEN_DESKTOP video mode, makes a fullscreen window the size of the desktop (i.e no window manager mode change)
- Fix crash in warp mouse if you specified null as the window
- Added new SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS Hint, if set to 0 then don't minimize a fullscreen window on focus lost (if not set or set to non-zero then minimize on focus loss)
2012-12-15 00:30:17 +00:00
Ryan C. Gordon
ed4988c379 Fixed comment on SDL_JoystickGetGUIDString(). 2012-12-11 16:53:38 -05:00
Sam Lantinga
eee39a0603 Don't build with X11 by default since it's not included with the latest versions of Mac OS X. Cocoa is the preferred path here. 2012-12-11 12:03:00 -08:00
Sam Lantinga
10abca2c02 Changes from Alfred:
- rename JoystickGUID -> SDL_JoystickGUID
- change SDL_JoystickGetGUIDString to take the string as an arg, rather than doing a malloc
2012-12-11 11:54:32 -08:00
Ryan C. Gordon
211e1cb7ec Updated Linux joystick code to support hotplug, GUIDs, etc.
This uses libudev for hotplug, but it's optional, so we'll just try to find
 some reasonable defaults without it (maybe an older Linux box or under
 FreeBSD's Linux emulation?).
2012-12-11 12:07:06 -05:00
Andreas Schiffler
e1c75c0fc9 Added existing common.c/.h functions to test lib; minor assert refactoring 2012-12-09 17:56:19 -08:00
Andreas Schiffler
e96fd5ab17 Added to harness in test lib (work in progress) 2012-12-04 19:21:10 -08:00
Andreas Schiffler
ca03267939 Update assert API in test lib; add to and harness; add test lib to VS2010 and VS2012 solution; fix VS2012 solution; fix compiler warning 2012-12-01 14:48:30 -08:00
Andreas Schiffler
7c313311a4 Add log, assert and harness (partial) to test lib 2012-11-30 23:25:34 -08:00
Andreas Schiffler
8515d11219 Add crc32 and md5 to test lib 2012-11-28 19:19:57 -08:00
Andreas Schiffler
2cfb6fbb8e Add fuzzer to test lib 2012-11-27 21:40:46 -08:00
Sam Lantinga
3f5fd55965 Organized joystick hotplug code a bit.
Cleaned up names, return types, etc.
2012-11-27 00:58:12 -08:00
Andreas Schiffler
8ee87a4da7 Add random module to test lib 2012-11-26 23:12:47 -08:00
Sam Lantinga
23950f0183 Added hotplug joystick support and simplified game controller API, courtesy of Alfred Reynolds 2012-11-26 16:37:54 -08:00
David Ludwig
9fc6a63d06 Merged with latest official SDL code 2012-11-26 16:58:41 -05:00
Sam Lantinga
9c2cdf677b Work in progress on an SDL test library 2012-11-26 07:53:56 -08:00
David Ludwig
aca89bc12b WinRT: fixed Win32 builds by prevented __WINRT__ from being defined 2012-11-25 14:45:04 -05:00
David Ludwig
a88bd2513b WinRT: got timers working 2012-11-24 12:07:35 -05:00
David Ludwig
3df1f642d6 WinRT: cleaned up SDL_platform_windowsrt.h 2012-11-24 11:46:15 -05:00
David Ludwig
c728870637 WinRT: disabled the XAudio2 backend, pending work on stability and quality 2012-11-24 11:20:59 -05:00
David Ludwig
eb5bc65363 WinRT: cleanups in SDL_platform.h 2012-11-23 00:02:27 -05:00
David Ludwig
a10ba5bcb9 WinRT: added a skeleton SDL backend for C++11-based threads 2012-11-22 23:03:56 -05:00
David Ludwig
18cc7d9a0c WinRT: got the XAudio2 backend compiling (but not running, yet) 2012-11-22 22:34:50 -05:00
David Ludwig
7a6a66c59e WinRT: made SDL_platform.h auto-detect WinRT 2012-11-22 13:11:05 -05:00
DavidLudwig
4f845c6e57 Merged with latest official SDL sources. 2012-11-12 13:25:44 -05:00
Sam Lantinga
d3d6706dfc SDL no longer grabs the keyboard by default on X11.
You can re-enable that functionality by setting a new hint SDL_HINT_GRAB_KEYBOARD
2012-11-07 15:55:43 -08:00
Sam Lantinga
4ff7b0238c Added SDL_ReadU8() and SDL_WriteU8() for consistency with the rest of the API. 2012-11-04 23:44:13 -08:00
Sam Lantinga
9e89faaf15 Synchronized the on-screen keyboard state with whether we are accepting text input.
The functions to show/hide/toggle the on-screen keyboard have been folded into the text input state.
Calling SDL_StartTextInput() will automatically show the on-screen keyboard if it's available.
Calling SDL_StopTextInput() will automatically hide the on-screen keyboard if it's available.
There is a new API function SDL_IsTextInputActive() which will return whether text input is currently active.
Text input is disabled by default, you must call SDL_StartTextInput() when you are ready to accept text input.
SDL_HasScreenKeyboardSupport() no longer needs to be passed a window.
The iPhone-specific on-screen keyboard functions have been removed.
2012-11-04 21:53:28 -08:00
David Ludwig
d202bff7f5 merged with latest sources 2012-11-04 13:22:40 -05:00
David Ludwig
1621b95c10 WinRT: fixed SDL_main-related linker error when __WINRT__ is defined in an app 2012-11-04 13:17:18 -05:00
Sam Lantinga
2a972eadfe Added documentation on loading assets on Android. 2012-11-04 09:45:18 -08:00
DavidLudwig
3114de8407 Merge with latest, official SDL code 2012-11-04 09:46:59 -05:00
David Ludwig
345e645cb5 WinRT: created a skeleton for a video driver, using a copy of the dummy driver for a base 2012-10-27 22:48:04 -04:00
David Ludwig
7b60f488d9 WinRT: disabled threads to prevent SDL_Init(SDL_INIT_VIDEO) from crashing 2012-10-27 22:27:51 -04:00
David Ludwig
39084bc6b8 WinRT: made SDL.dll compile for ARM (and not just x86 or x64) 2012-10-27 18:39:09 -04:00
David Ludwig
db346c5593 WinRT: used Win32-style DECLSPEC and SDLCALL macros (for building a .dll) 2012-10-27 18:21:31 -04:00
Sam Lantinga
e7ea5f6646 Added an API to get the size of a file - WARNING! ABI CHANGE! 2012-11-03 18:43:36 -07:00
Ryan C. Gordon
6c4223b251 More compiler warning fixes. 2012-11-02 14:03:14 -04:00
Ryan C. Gordon
28fbd54ae5 Fixed compiler warnings about "/*" inside a multi-line comment. 2012-11-02 14:00:44 -04:00
Sam Lantinga
525b3ca0e9 Added some platform specific API functions for Android:
SDL_AndroidGetJNIEnv()
SDL_AndroidGetActivity()
SDL_AndroidGetInternalStoragePath()
SDL_AndroidGetExternalStorageState()
SDL_AndroidGetExternalStoragePath()
2012-11-02 02:22:32 -07:00
Sam Lantinga
017bece619 We might actually have PI 2012-11-01 00:12:57 -07:00
Sam Lantinga
4bbe3a7073 Added an assert log category, and NSLog support on Mac OS X and iOS 2012-10-30 12:30:02 -07:00
Sam Lantinga
07f0419650 Added some documentation on the behavior of SDL_ShowMessageBox() 2012-10-30 10:07:32 -07:00
Sam Lantinga
35feaaaf51 It turns out that UCS2 and UCS4 are defined as big-endian encodings 2012-10-28 13:03:45 -07:00
Sam Lantinga
82f91da2d0 Added API for simple messagebox, courtesy of Mike Sartain 2012-10-23 17:11:22 -07:00
Sam Lantinga
93902fa034 Updated the copyright date on the default config file 2012-10-23 15:59:07 -07:00
Sam Lantinga
73c7d679a0 Switch C++ comment to C comment 2012-10-21 22:18:36 -07:00
Sam Lantinga
49796bf2b6 Fixed another gcc <-> Visual C++ ABI issue 2012-10-20 00:49:08 -07:00
Sam Lantinga
9090fb9b4c Make it possible to build a DLL with mingw that's ABI compatible with Visual C++ built applications 2012-10-20 00:14:58 -07:00
David Ludwig
3c1316c04c Got a bare-bones version of SDL compiling for Windows RT. Dummy drivers are used in some places. Very little Windows-specific code (from the Win32 version of SDL) is used. 2012-10-17 21:43:20 -04:00
DavidLudwig
32ab0b21a7 merged with the latest, official, SDL 2 sources 2012-10-15 21:14:13 -04:00
Sam Lantinga
9a6b1c641a Added SDL_GetRenderTarget() API function
Also fixed a bug with setting logical size for a render target.
2012-10-12 02:20:10 -07:00
Sam Lantinga
a1f39a5854 I'm becoming more and more convinced that the application should never use XRandR, and it's the window manager's responsibility to track and manage display modes for fullscreen windows.
Because it's so broken, I'm going to disable XRandR by default.  You can still enable it via environment variable or application hint (SDL_HINT_VIDEO_X11_XRANDR)
2012-10-04 13:50:41 -07:00
Sam Lantinga
aab04f8c71 Added SDL_RenderSetLogicalSize() and SDL_RenderGetLogicalSize() 2012-10-01 22:30:07 -07:00
Sam Lantinga
8e121270fa Added SDL_RenderSetScale() and SDL_RenderGetScale() 2012-10-01 20:59:33 -07:00
Sam Lantinga
ed4f2e1ccf Made it clear that locking a streaming texture is a write-only operation. 2012-09-28 03:29:36 -07:00
Sam Lantinga
225faf6595 Turned the X11 mode extension environment variables into hints so they can be more easily set from applications. 2012-09-27 11:29:13 -07:00
Gabriel Jacobo
8408ace068 Make SDL_atomic.h depend on the void pointer size determined at compile time
rather than at configure time. As OS X supports lipo'ed versions of SDL for i386
and x86_64, a single set of headers that work for both architectures is desired.
2012-09-26 15:57:28 -03:00
Sam Lantinga
e52130b426 Fixed bug 1606 - SDL does not implement SDL_GetPowerInfo() for Android.
Philipp Wiesemann 2012-09-22 05:26:11 PDT

currently SDL (HG) does not implement the power management functionality of
SDL_GetPowerInfo() for Android.

I attached a patch which tries to implement this functionality (JNI only, API
5). It supports plugged state and battery percent return values but not
remaining seconds (which are not available on Android).
2012-09-23 01:37:44 -07:00
Ryan C. Gordon
b3b40aac16 Removed Windows CE support from SDL 2.0.
It's a long-dead platform, and we don't have any way to build for, test, or
maintain it, so there's no sense in doing acrobatics to support it.

If you need Windows CE support, use SDL 1.2. If you need Windows Phone support,
send SDL 2.0 patches for the newer Windows Mobile platform.
2012-09-15 10:59:39 -04:00
Ryan C. Gordon
0c926d9aea Fixed a typo in the docs. 2012-09-14 18:18:38 -04:00
Ryan C. Gordon
49d8c6fb12 Added SDL_SetWindowBordered() API. 2012-09-13 01:43:53 -04:00
Gabriel Jacobo
ceaf031283 Implements SDL_GL_BindTexture and SDL_GL_UnbindTexture (#1576) 2012-09-03 11:16:12 -03:00
DavidLudwig
693055adb2 Merged with latest SDL2 sources 2012-09-01 07:19:49 -04:00
Sam Lantinga
03410caaaf Renamed SDL_GL_CONTEXT_PROFILE_ES2 to SDL_GL_CONTEXT_PROFILE_ES 2012-08-12 23:10:16 -07:00
Sam Lantinga
c5eed5e522 Fixed bug 1565 - some small GL context creation enhancements
Matthias Bentrup 2012-08-09 12:53:17 PDT

With OpenGL 4.3 the ARB added a new context flag for context reset isolation
and renamed the existing ES2 profile bit to ES profile bit, as it can be used
to request GLES 3 compatible contexts, too.

This patch adds these changes to SDL on Linux and Windows.

Also SDL lacks the ability to create shared contexts. This patch also adds a
new GL attribute to enable context sharing. As casting a GL context to int is
not portable, I added only a boolean attribute
SDL_GL_SHARE_WITH_CURRENT_CONTEXT, which makes the new context share resources
with the context current on the creating thread.
2012-08-12 11:16:24 -07:00
Sam Lantinga
e6d37e6522 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Philipp Wiesemann implemented a general on-screen keyboard API for SDL, and I switched iOS code over to use it.
2012-08-11 10:15:59 -07:00
Ryan C. Gordon
4abe53d466 Fixed building on Mac OS X with Xcode 4.4 (OS X 10.8 SDK).
I think you'll need to install Xquartz, the external-but-official replacement
 for Apple's X11, to get the Xlib headers: http://support.apple.com/kb/HT5293
2012-08-09 15:43:39 -04:00
Ryan C. Gordon
f32956dc1b Add support for (GLX|WGL)_EXT_swap_control_tear.
This required a small public API change: SDL_GL_SetSwapInterval() now accepts
 negative values, and SDL_GL_GetSwapInterval() doesn't report errors anymore
 (if it can't work, it'll return zero as a reasonable default).

If you need to test for errors, such as a lack of swap_control_tear support,
 check the results of SDL_GL_SetSwapInterval() when you set your desired
 value.
2012-08-01 20:29:36 -04:00
Sam Lantinga
d4219579f2 Fixed clang -Weverything warnings 2012-11-22 11:55:11 -08:00
stopiccot
0bb179ae8a SetMinimumWindowSize for OS X 2012-11-18 15:45:12 +03:00
Ryan C. Gordon
b8d7fecdf7 Removed some tab chars. 2012-11-21 23:00:06 -05:00
Ryan C. Gordon
4380a1eacf Removed commas at the end of enums, to make gcc's -pedantic happy.
Fixes Bugzilla #1647.
2012-11-21 22:59:42 -05:00
Sam Lantinga
ee5bc4e7ab Added code to testwm2 to test the system cursor support 2012-11-19 20:38:52 -08:00
Michael Sartain
f4161f1ea6 Add SDL_CreateSystemCursor for Windows and Linux. 2012-11-19 15:11:10 -08:00