Commit graph

7611 commits

Author SHA1 Message Date
Alex Szpakowski
1e2d5c6bc4 Added iOS-specific functions to get the window view's current OpenGL Renderbuffer and Framebuffer objects, so they can be more easily rebound when necessary.
--HG--
branch : iOS-improvements
2014-08-08 15:14:09 -03:00
Alex Szpakowski
9858389e85 Fixed opengl context share groups on iOS.
--HG--
branch : iOS-improvements
2014-08-07 00:44:16 -03:00
Alex Szpakowski
87b8ce9ae2 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2014-08-06 13:50:50 -03:00
Sam Lantinga
298925e01f 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
Alex Szpakowski
aa04782886 Merged default into iOS-improvements
--HG--
branch : iOS-improvements
2014-08-06 03:32:59 -03:00
Alex Szpakowski
9e4e1cac69 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
b85f8a9917 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
2b71883624 Minor code update for less verbosity
--HG--
branch : iOS-improvements
2014-08-06 00:45:11 -03:00
Alex Szpakowski
8325271501 Merged branch default into iOS-improvements
--HG--
branch : iOS-improvements
2014-08-04 15:30:53 -03:00
Alfred Reynolds
3e9232ec06 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
Alex Szpakowski
15ceae8c9c Merged 'default' into branch 'iOS-improvements'
--HG--
branch : iOS-improvements
2014-07-31 03:14:10 -03:00
Alfred Reynolds
194112d3fe 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
7f5f9af5ab 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
b8e90cf635 Fixed comment typo. 2014-07-30 14:12:54 -04:00
Ryan C. Gordon
1c826fa22c SDL_GetQueuedAudioSize() shouldn't grab lock when not set up for queueing. 2014-07-30 11:11:48 -04:00
Ryan C. Gordon
5a25e7950c 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
f4f2649e6a 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
91bbc7d9fa Moved documentation to docs, recreated a simple README.txt, fixed build
--HG--
rename : doc/README-SDL.md => README-SDL.txt
rename : doc/README-android.md => docs/README-android.md
rename : doc/README-cmake.md => docs/README-cmake.md
rename : doc/README-directfb.md => docs/README-directfb.md
rename : doc/README-dynapi.md => docs/README-dynapi.md
rename : doc/README-gesture.md => docs/README-gesture.md
rename : doc/README-hg.md => docs/README-hg.md
rename : doc/README-ios.md => docs/README-ios.md
rename : doc/README-linux.md => docs/README-linux.md
rename : doc/README-macosx.md => docs/README-macosx.md
rename : doc/README-nacl.md => docs/README-nacl.md
rename : doc/README-pandora.md => docs/README-pandora.md
rename : doc/README-platforms.md => docs/README-platforms.md
rename : doc/README-porting.md => docs/README-porting.md
rename : doc/README-psp.md => docs/README-psp.md
rename : doc/README-raspberrypi.md => docs/README-raspberrypi.md
rename : doc/README-touch.md => docs/README-touch.md
rename : doc/README-wince.md => docs/README-wince.md
rename : doc/README-windows.md => docs/README-windows.md
rename : doc/README-winrt.md => docs/README-winrt.md
rename : doc/README.md => docs/README.md
rename : doc/doxyfile => docs/doxyfile
2014-07-29 08:04:15 -07:00
Gabriel Jacobo
9509486801 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
383f56a9c1 Added missing autorelease pool blocks in UIKit backend code. Fixes memory leak issues, especially in SDL_video.
--HG--
branch : iOS-improvements
2014-07-29 00:36:12 -03:00
Alex Szpakowski
2e0c23e436 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
d9bf955208 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
c43be6965f Turned on OmitDefaultLibName for SDL, SDLmain and SDLtest 2014-07-27 19:56:53 -07:00
Ryan C. Gordon
74ff58fdaf Remove dependency on C runtime from Windows SDLmain. 2014-07-27 19:52:52 -04:00
Sam Lantinga
2fd74d97af Fixed bug 2537 - _allmul in SDL_lib.c is not working properly 2014-07-27 17:44:10 -07:00
Sam Lantinga
8d41429a9b Fixed uninitialized variable in some cases 2014-07-27 17:43:36 -07:00
Alex Szpakowski
c02063db69 Fixed SDL_SetWindowFullscreen on iOS causing the window's reported dimensions and supported orientations to go out of sync with what they should be, if the device orientation was different from the screen orientation when the function call was made.
--HG--
branch : iOS-improvements
2014-07-24 22:35:25 -03:00
Alex Szpakowski
995d5ef814 Integrated Phil Hassey's patch to fix SDL_IsScreenKeyboardShown on iOS (https://bugzilla.libsdl.org/show_bug.cgi?id=2660)
--HG--
branch : iOS-improvements
2014-07-23 22:35:14 -03:00
Alex Szpakowski
e34e3dfd5c Fixed SDL_SetWindowFullscreen on iOS for the last time, hopefully.
Fixed iOS version checking code.

--HG--
branch : iOS-improvements
2014-07-23 21:55:42 -03:00
Alex Szpakowski
6ebdaca672 More cleanup of the iOS Objective-C code.
--HG--
branch : iOS-improvements
2014-07-23 03:05:31 -03:00
Alex Szpakowski
d53e8dc61a 90% of iOS users on the App Store run at least iOS 7, so it doesn't make sense to support building using an SDK that doesn't support iOS 7. The minimum supported runtime version is still iOS 5.1.
--HG--
branch : iOS-improvements
2014-07-23 01:33:59 -03:00
Alex Szpakowski
689ed320a9 Updated the iOS Objective-C code to use NSDictionary/NSArray/NSNumber literals and subscripting, for improved code clarity.
This requires at least Xcode 4.5 and the iOS 6 SDK to build, but it doesn't change the minimum supported runtime version (iOS 5.1). Less than 2% of iOS users are running iOS 5, so I hope developers aren't trying to build SDL using an SDK which doesn't support iOS 6/7...

--HG--
branch : iOS-improvements
2014-07-23 01:28:24 -03:00
Ryan C. Gordon
a261470598 Added audio device buffer queueing API.
--HG--
extra : rebase_source : a454256d88e413a4898b5005472625f755abfad4
2014-07-22 21:41:49 -04:00
Sam Lantinga
cb2cf20706 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
7f5d524dca Clarifying hard-to-understand piece of code.
--HG--
extra : histedit_source : c70605fa116a69214f22cb1352939b1ec67287c8
2014-07-22 23:12:21 -04:00
Alex Szpakowski
adff9206e3 Cleaned up iOS OpenGL ES context creation code and added sRGB context support on iOS 7+
--HG--
branch : iOS-improvements
2014-07-22 20:06:13 -03:00
Alex Szpakowski
e1d84374a1 Fixed SDL_SetWindowFullscreen on iOS to properly update the view's frame.
--HG--
branch : iOS-improvements
2014-07-22 16:48:35 -03:00
Alex Szpakowski
7f3ba59f8b The default implementation of [view layoutSubviews] actually does something in iOS 6+, so we should call [super layoutSubviews] when overriding it.
--HG--
branch : iOS-improvements
2014-07-21 02:46:53 -03:00
Brandon Schaefer
07dc19edb1 Dont redeclare DBusMessage* msg; 2014-07-18 14:10:45 -07:00
Alex Szpakowski
e83e29ce07 Disabled the custom iOS splashscreen code - it interferes with the normal rotation and orientation behaviour of SDL windows.
--HG--
branch : iOS-improvements
2014-07-17 22:55:59 -03:00
Alex Szpakowski
cd7a8a2dd4 Properly send a window resize event in all cases when viewDidLayoutSubviews is triggered.
--HG--
branch : iOS-improvements
2014-07-17 18:05:12 -03:00
Alex Szpakowski
540f7a01e3 Fixed SDL_HINT_ORIENTATIONS to properly allow disabling custom orientations if the hint is set with no valid orientations.
--HG--
branch : iOS-improvements
2014-07-16 21:06:15 -03:00
Alex Szpakowski
7781a97023 The iOS 7 transparent status bar now uses white text rather than black.
--HG--
branch : iOS-improvements
2014-07-16 20:05:00 -03:00
Alex Szpakowski
d67085b17c Fixed SDL_SetWindowFullscreen not properly updating the status bar visibility in iOS 7+
--HG--
branch : iOS-improvements
2014-07-16 16:12:20 -03:00
Alex Szpakowski
52f0e36925 Minor fix for if SDL_JoystickInit is called more than once without a matching SDL_JoystickQuit.
--HG--
branch : iOS-improvements
2014-07-15 02:04:08 -03:00
Alex Szpakowski
701d88bb5b iOS now respects SDL_HINT_ACCELEROMETER_AS_JOYSTICK.
--HG--
branch : iOS-improvements
2014-07-15 02:01:43 -03:00
Alex Szpakowski
2ea3b21ca3 Changed the way retina resolutions are handled in iOS.
Previously, SDL would always expose display modes and window dimensions in terms of pixels, and would add an extra 'fake' display mode on retina screens which would contain the non-retina resolution. Calling SDL_CreateWindow with the dimensions of that fake display mode would not work.

Now, SDL only exposes display modes and window dimensions in terms of points rather than pixels. If the SDL_WINDOW_ALLOW_HIGHDPI flag is passed into SDL_CreateWindow, then any OpenGL contexts created from that window will be sized in pixels rather than points (retrievable with SDL_GL_GetDrawableSize.) Window dimensions and mouse coordinates are still in terms of points rather than pixels even with that flag.

This matches the behavior of SDL in OS X more closely, and lets users choose whether to make use of retina displays and lets them handle it properly.

--HG--
branch : iOS-improvements
2014-07-14 22:35:48 -03:00
Alex Szpakowski
c351e27667 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
023d1d048c 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
0e78b5780a Fixed bug 2639 - SDL_BLENDMODE_BLEND not working properly for software renderer, thanks to Melker Narikka 2014-07-12 16:21:56 -07:00