Commit Graph

1265 Commits

Author SHA1 Message Date
David Ludwig ff5caa1721 WinRT build fix for ARM platforms
The _xgetbv intrinsic was being used in ARM builds of SDL/WinRT, which was
leading to linker errors.  This commit limits _xgetbv use to the platforms on
which it is available, x86 and x64.
2014-08-10 22:21:21 -04:00
Sam Lantinga 6fef39d6b8 Added NV12 and NV21 texture support for OpenGL and OpenGL ES 2.0 renderers 2014-08-06 11:34:54 -07:00
Sam Lantinga 6299daecba The OpenGL context returned by the UIKit backend is now an actual OpenGL context instead of the OpenGL view we created.
This allows you to use the returned context in functions like CVOpenGLESTextureCacheCreate()
2014-08-06 00:28:02 -07:00
Sam Lantinga 2eb7563e35 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
Alfred Reynolds 87b8c8d108 SDL - when raising the window under OSX also force the app to activate. This fixes a fullscreen window on a separate space not coming front when raisewindow is called. 2014-07-31 12:46:23 -07:00
Alfred Reynolds 7552947654 SDL - fix re-entrancy into SDL_UpdateFullscreenMode under OSX. During HideWindow we get a RESTORED event which then turns fullscreen back on causing a hang in Cocoa_SetWindowFullscreenSpace waiting for the fullscreen transition to finish. 2014-07-30 17:45:52 -07:00
Ryan C. Gordon 5b780063e1 Make SDL_SysWMinfo usable on Mac/iOS with ARC enabled (thanks, Alex!).
Fixes Bugzilla #2641.
2014-07-30 14:14:19 -04:00
Ryan C. Gordon c0f9a57f71 Fixed comment typo. 2014-07-30 14:12:54 -04:00
Ryan C. Gordon c5b21ea6c1 SDL_GetQueuedAudioSize() shouldn't grab lock when not set up for queueing. 2014-07-30 11:11:48 -04:00
Ryan C. Gordon e5d49c2033 Added a GetPendingBytes method to the audio backend.
This will (eventually) make SDL_GetQueuedAudioSize() more accurate, and thus
reduce latency. Right now this isn't implemented anywhere, so we assume data
fed to the audio callback is consumed by the hardware and immediately played
to completion.
2014-07-30 11:08:31 -04:00
Ryan C. Gordon db1dd7560e XAudio2: Use XAUDIO2_VOICE_NOSAMPLESPLAYED when possible.
For versions of XAudio2 with an IXAudio2SourceVoice::GetState() that offers a
flags parameter, we can use XAUDIO2_VOICE_NOSAMPLESPLAYED, since we don't
need this information in our current calls. According to MSDN, this makes the
the call about 3x faster.
2014-07-30 09:54:01 -04:00
Sam Lantinga e76fecc4ed Moved documentation to docs, recreated a simple README.txt, fixed build 2014-07-29 08:04:15 -07:00
Gabriel Jacobo f982d08784 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
Ryan C. Gordon 0c09ce2b34 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
Sam Lantinga 164de2325e Turned on OmitDefaultLibName for SDL, SDLmain and SDLtest 2014-07-27 19:56:53 -07:00
Ryan C. Gordon 2230df5525 Remove dependency on C runtime from Windows SDLmain. 2014-07-27 19:52:52 -04:00
Sam Lantinga a0b68e817d Fixed bug 2537 - _allmul in SDL_lib.c is not working properly 2014-07-27 17:44:10 -07:00
Sam Lantinga 5c6c86912d Fixed uninitialized variable in some cases 2014-07-27 17:43:36 -07:00
Ryan C. Gordon f30e120aa9 Added audio device buffer queueing API. 2014-07-22 21:41:49 -04:00
Sam Lantinga dfc7535ff7 Fixed bug 2657 - Memory leak in GL_CreateTexture function
Nitz

In GL_CreateTexture function:

if (GL_CheckError("glGenTexures()", renderer) < 0) {
        SDL_free(data);
        return -1;
    }

Here only data is getting free but data->pixels getting leak.
So have to free data->pixels before free data.
2014-07-26 16:52:26 -07:00
Ryan C. Gordon 987c335551 Clarifying hard-to-understand piece of code. 2014-07-22 23:12:21 -04:00
Brandon Schaefer 75dacdb99b Dont redeclare DBusMessage* msg; 2014-07-18 14:10:45 -07:00
Sam Lantinga 96b613eab3 Fixed bug 2640 - Unable to SDL_SetRenderTarget to original surface for software renderer without a window
Damian Kaczmarek

Basically this bug is probably not a common use case. My goal is to allow rendering totally without a window, for example to a screenshot and I need to rely on SDL_SetRenderTarget to properly work for a purely software renderer created by SDL_CreateSoftwareRenderer.
2014-07-13 09:04:55 -07:00
Sam Lantinga fd1da994fa Fixed bug 2639 - SDL_BLENDMODE_BLEND not working properly for software renderer, thanks to Melker Narikka 2014-07-12 16:21:56 -07:00
Sam Lantinga d1ca658c45 Fixed bug 2638 - (Signed) Can't create signed apps in Android
Pablo Mayobre

When generating a signed app with SDL 2.0.3 an issue comes up, watching at the Error Log points out that the issue lies in the src/main/android/SDL_android_main.c where the process name is defined as "SDL_app", this name turns into an erroneous name so it should be changed to "app_process"
2014-07-12 13:05:41 -07:00
Sam Lantinga 454c4a019f Fixed Visual Studio 2010 build 2014-07-11 22:15:34 -07:00
Sam Lantinga 6a1011ae6d Fixed build for arm platforms 2014-07-11 22:14:14 -07:00
Sam Lantinga eb1c6044b2 Fixed bug in AVX detection and added AVX2 detection 2014-07-11 22:02:50 -07:00
Sam Lantinga f1ca7bd167 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 f7461cdc9a The Gimp puts out a different bogus color mask for 32-bit .bmp files. :) 2014-07-09 00:09:57 -04:00
Ryan C. Gordon a91f1a1adc Make SDL_LoadBMP() work with 32-bit bitmaps from ImageMagick. 2014-07-09 00:01:34 -04:00
Ryan C. Gordon 0e9c0855f5 Comment update: SDL_INIT_NOPARACHUTE doesn't do anything as of 2.0.0. 2014-07-08 16:17:06 -04:00
Sam Lantinga 19d878d711 Skip JUNK chunks in wave files 2014-07-08 00:42:14 -07:00
Sam Lantinga 35ec0075cf Strip the binaries before signing them, in release configuration 2014-07-08 00:23:36 -07:00
Sam Lantinga ed30c80c5c Fixed supporting multiple frameworks 2014-07-07 23:48:21 -07:00
Sam Lantinga 9bd483439e Fixed code signing release frameworks 2014-07-07 23:40:10 -07:00
Andreas Schiffler 962c9911ce Update audio testautomation: more coverage; added SDL_PauseAudio test /w callback coverage 2014-07-07 23:33:57 -07:00
Sam Lantinga d23d9c88e5 Fixed bug 2421 - SDL_RenderCopyEx off by one when rotating by 90 and -90
chasesan

When using SDL_RenderCopyEx, I get a problem on some platforms where the output is offset by +/-1 on other platforms and not on others. I tried it with a center of both 0,0 (and offsetting by width/height) and NULL (for centered).

The rotation involved is 90, and/or -90 rotation. The rotation was a constant, no arithmetic was involved when inputting it into SDL_RenderCopyEx.

This occurred with 32x32, 24x24, and 16x16 texture sizes. I apologize that I don't have more precise information, as I received the information as a bug report myself. But I have tracked the problem down to here.

My program requires pixel perfect alignment on several different platforms, so this is something of a showstopper for me.

--

Sylvain

It appears the RenderCopyEx is done as expected,
this is the red rectangle which is not correctly positionned !

So, here's patch with a 0.5 float increment, like for opengles2, for DrawLines, and also Draw Points.
2014-07-07 23:26:34 -07:00
Sam Lantinga ef39d1d1ff Updated configure after removing pthread spinlock support 2014-07-07 21:34:04 -07:00
Sam Lantinga 8077bf3d10 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
Sam Lantinga 0c8e33764c Fixed bug 2628 - invalidate surface->map in SDL_SurfacePalette()
Wei Mingzhi

surface->map should be invalidated in SDL_SetSurfacePalette(), otherwise the palette would not be effective when blitting to another non-8bit surface which we previously blitted to.
2014-07-07 21:21:05 -07:00
Andreas Schiffler 97bdefe2ab Enable 2 disabled audio tests (since bug 1396 is fixed and they pass now) 2014-07-07 20:26:21 -07:00
Sam Lantinga cd8f63f280 Hopefully fixed Cygwin build 2014-07-07 13:21:54 -07:00
Sam Lantinga a2d5dd0234 Removed useless assert 2014-07-07 13:19:53 -07:00
Sam Lantinga fc4e798d79 Fixed bug 2631 - Mac: minor code cleanup
Alex Szpakowski

Some minor changes to the Mac-specific backend code:

- Fixed up some code style issues (mostly brace style inconsistencies).

- Fixed a compiler warning in SDL_cocoaevents.m.

- Removed some useless code now that the 10.7 SDK is required to build SDL.

- Removed Gestalt(gestaltSystemVersion, ...) call and switched to NSAppKitVersionNumber for version checking code. Using Gestalt with gestaltSystemVersion will give 0x1090 in Mac OS 10.10+, and the whole Gestalt function was deprecated in Mac OS 10.8.
2014-07-07 12:48:25 -07:00
Sam Lantinga febc47976b SDL_SYS_IsXInputGamepad_DeviceIndex() is only available if SDL_JOYSTICK_XINPUT is true. 2014-07-07 11:44:14 -07:00
Sam Lantinga c1d29725a8 Fixed indentation for pnacl configuration 2014-07-07 11:13:19 -07:00
Sam Lantinga 7187b74cf4 Fixed compiler warnings on iOS 2014-07-07 11:00:25 -07:00
Sam Lantinga 017c5dc381 Fixed bug 2626 - iOS: fix test and template Xcode projects and build scripts to link with CoreMotion
Alex Szpakowski

Now that SDL on iOS requires CoreMotion to be linked, some of the Xcode projects included with the SDL source (such as the iOS tests and the iOS app template) as well as the premake and automake scripts need to be updated.

I've attached a patch which does so. It also fixes the SDL Xcode project to build for 64-bit ARM as well as armv7 by default (or whatever the default ARM targets are for the Xcode version used), which is what the iOS app template expects.
2014-07-07 10:42:19 -07:00
Sam Lantinga de1b22e74e Fixed compiler warning 2014-07-07 10:39:02 -07:00