Commit Graph

1257 Commits

Author SHA1 Message Date
Sam Lantinga eba65c66a3 Fixed bug 2694 - configure bug __has_feature macro not detected
skaller

using gcc 4.2 (the default) on Mac OSX 10.6.8

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

The fault appears to be here:

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

that the __has_feature macro is not supported by gcc 4.2.

The code works fine with my clang 3.3svn.
2014-08-19 21:17:21 -07:00
Sam Lantinga 04f7422552 Fixed bug 2691 - Disabling shared library prevent cmake configuration
hotgloupi

Configuring using "cmake -DSDL_STATIC=1 -DSDL_SHARED=0" generate and error in CMakeLists.txt at line 1334:

CMake Error at CMakeLists.txt:1334 (install):
  install TARGETS given target "SDL2" which does not exist in this directory.

This install rule shouldn't be present when the DLL has been disabled
2014-08-19 21:13:07 -07:00
Sam Lantinga 5a752c3aa7 Better Mac OS X build fix - actually match the SDK OpenGL headers. 2014-08-18 18:44:08 -07:00
Sam Lantinga 4b8f75381f Fixed Mac OS X build 2014-08-18 18:17:03 -07:00
Sam Lantinga bbab38552a SDL - fix fullscreen desktop windows not restoring to fullscreen state if focus changes happen due to programtic window changes (and not user alt-tabbing) 2014-08-18 18:16:45 -07:00
Sam Lantinga 877666e237 Fixed UV texture coordinate scale when using GL_ARB_texture_non_power_of_two 2014-08-18 11:28:16 -07:00
Ryan C. Gordon f4d3303c9e Don't use the system OpenGL headers, ever.
(the replacement header is from Mesa, under what the MIT license.)
2014-08-18 14:05:02 -04:00
Sam Lantinga d1cc47b337 Fixed 2680 - OSX: Replace NSAutoreleasePool with @autoreleasepool
Tim McDaniel

This patch replaces all use of NSAutoreleasePool with the Apple recommended @autoreleasepool.  @autoreleasepool is supposedly more efficient, and since it is scope based it can't be accidentally not released.
2014-08-17 15:07:00 -07:00
Sam Lantinga 5e50180415 Fixed bug 2655 - OSX: Window position and global mouse coord spaces are different
Tim McDaniel

On OSX, with revision 8729, the coordinate space for window position and the coordinate space for global mouse position don't match.  For a non-fullscreen window, the window position is global relative to the bottom of the menubar.  The global mouse position is relative to the top of the screen.  This affects Cocoa_WarpMouse and potentially other things as well.  Further, the coordinate system for window position is now affected by what screen it is on.  For example, if I have two equal size screens oriented side by side such that the tops of the screens are equal in global space, with the menubar on one screen, and a window straddles the two screens, the window's y position makes no sense.  The window's y position depends on what screen "most" of the window is on.  So if I move the window horizontally just a bit, the y position of my window is now different by the size of the menubar, even though the window was not moved vertically.

I'd like to reiterate that this was a fairly fundamental change (and a breaking change for us).  If SDL OSX is to really support multi-display configurations, this is especially problematic.

If the real concern is preventing windows from going under the menubar, then perhaps a solution involving something like overriding [NSWindow constrainFrameRect] would be less problematic than redefining the global window coord space for the main display.
2014-08-17 14:57:52 -07:00
Sam Lantinga de3d381cb6 Fixed bug 2685 - SDL_RenderReadPixels() doesn't work with offscreen targets
Andreas Falkenhahn

SDL_RenderReadPixels() doesn't seem to work when trying to read pixels from a texture that has been created using SDL_TEXTUREACCESS_TARGET and has been selected as the render target using SDL_SetRenderTarget().

I am attaching a small program that demonstrates the issue. I get the following result here:

READ PIXEL RETURN: 0 --- COLOR CHECK: ff000000

But it should be:

READ PIXEL RETURN: 0 --- COLOR CHECK: ffff0000

Tested with SDL 2.0.3 on Windows 7.
2014-08-17 14:44:53 -07:00
Sam Lantinga 2e3c778ef5 Fixed bug where the render target is updated instead of the default output when the window is resized. 2014-08-17 14:34:41 -07:00
Sam Lantinga f17587df4a Reset CMAKE_REQUIRED_FLAGS after test 2014-08-17 13:49:53 -07:00
Sam Lantinga 95ced654cb cmake: add -Wl,--no-undefined to GCC linker flags
This way unresolved symbols will be detected when linking the shared
library version.
2014-08-17 13:15:45 -07:00
Sam Lantinga 569e595a1b cmake: add -Wall/-Wshadow to GCC compilation flags 2014-08-17 13:15:09 -07:00
Sam Lantinga 1ea8697894 Removed SDL_round() because the license wasn't compatible with zlib 2014-08-17 13:11:55 -07:00
Sam Lantinga 2a13cab927 Fixed bug 2688 - failure to build test/loopwavequeue.c on Linux 2014-08-17 10:10:41 -07:00
Sam Lantinga 529ed53b16 Fixed bug 2681 - dereference a NULL pointer dst_fmt in SDL_CreateTextureFromSurface function
Nitz

In SDL_CreateTextureFromSurface:

SDL_PixelFormat *dst_fmt;
/* Set up a destination surface for the texture update */
         dst_fmt = SDL_AllocFormat(format);
            temp = SDL_ConvertSurface(surface, dst_fmt, 0);

Here is need of NULL check for dst_fmt because there are chances of NULL return from SDL_AllocFormat(format);
2014-08-16 23:30:44 -07:00
Sam Lantinga 984d0fc40b Fixed bug 2683 - Raspberry PI support using CMake
Tobias Himmer

this patch adds a check to the CMake build script to detect whether the VideoCore API is available.
If it is found, it enables SDL_VIDEO_DRIVER_RPI and will also add the needed include/library directory flags to CMAKE_C_FLAGS so the subsequent check for GLES succeeds in picking up the headers.

Seems to work fine on Raspbian.
2014-08-16 23:28:40 -07:00
Sam Lantinga 8272ed1819 Fixed bug 2687 - SDL_BlitScaled does not handle clipping correctly
Patch from Benoit Pierre:

video: fix clipping handling in SDL_UpperBlitScaled

- honor destination clipping rectangle
- update both destination and source rectangles when clipping source
  rectangle to source surface and destination rectangle to destination
  clip rectangle
- don't change scaling factors when clipping

N.B.:

- when no scaling is involved (source and destination width/height are
  the same), SDL_UpperBlit is used (so SDL_BlitScaled behaves like
  SDL_BlitSurface)
- the final destination rectangle after all clipping is performed is
  saved back to dstrect (like for SDL_UpperBlit)
2014-08-16 23:25:02 -07:00
Sam Lantinga 4e7db78ed9 Added SDL_round(), contributed by Benoit Pierre - thanks! 2014-08-16 23:23:15 -07:00
Sam Lantinga d673d8c389 Fixed bugs 2677 and 2625, made it possible to lock render targets in D3D 2014-08-16 23:17:47 -07:00
Sam Lantinga 384c204761 Fixed building on Windows with CMake 2014-08-16 15:18:21 -07:00
Ryan C. Gordon d72c61d8c7 Haptic: Add some missing haptic types to test, and fix wrong array-sizes.
Thanks, Elias!

Fixes Bugzilla #2686.
(along with the last several commits.)
2014-08-16 16:50:10 -04:00
Ryan C. Gordon e2bbc17d11 Haptic: Fix clamping bugs on Windows, by using the Darwin haptics code.
Thanks, Elias!

Partially fixes Bugzilla #2686.
2014-08-16 16:49:00 -04:00
Ryan C. Gordon 57db27909b Haptic: Fix the saturation and deadband parameters' available range.
There was a misconception that Linux's saturation and deadband parameters -
on which the corresponding SDL parameters were based - use only half of the
possible range.

Thanks, Elias!

Partially fixes Bugzilla #2686.
2014-08-16 16:47:42 -04:00
Ryan C. Gordon a2622ce6e0 Haptic: Explicitly avoid floating point arithmetic if it's not needed.
Thanks, Elias!

Partially fixes Bugzilla #2686.
2014-08-16 16:42:55 -04:00
Ryan C. Gordon 1db581b4ca Haptic: DInput's POLAR direction actually matches Linux's direction.
Thanks, Elias!

Partially fixes Bugzilla #2686.
2014-08-16 16:41:25 -04:00
Ryan C. Gordon 3e27013b98 Haptic: Don't interpret a direction of polar 35999 as "unsupported type".
(or linux-direction 0xFFFF)

Thanks, Elias!

Partially fixes Bugzilla #2686.
2014-08-16 16:40:01 -04:00
Philipp Wiesemann 6d9dbf5e1e Fixed markdown formatting in READMEs. 2014-08-15 23:39:14 +02:00
Philipp Wiesemann c5aa0d8081 Updated README. 2014-08-15 23:18:57 +02:00
Philipp Wiesemann e0eb6714cc Fixed enumeration in README. 2014-08-15 23:13:51 +02:00
Sam Lantinga c6a2382c66 Take advantage of GL_ARB_texture_non_power_of_two when it's available 2014-08-14 21:31:50 -07:00
Philipp Wiesemann 2c1faa40eb Fixed warnings about unused local variables. 2014-08-12 23:37:12 +02:00
Philipp Wiesemann 197a7cae5f Fixed warning about implicit boxing to Java Object. 2014-08-12 23:33:16 +02:00
Philipp Wiesemann cfaa99bb56 Fixed doxygen warnings and markdown formatting. 2014-08-12 23:28:45 +02:00
Sam Lantinga 05d8780022 Implemented SDL_GetPrefPath() on Android - it returns the path used by SDL_AndroidGetInternalStoragePath() 2014-08-11 17:25:53 -07:00
Sam Lantinga 4fe43f408b Added an entry for the new Steam controller XInput emulation mode 2014-08-11 17:24:54 -07:00
Philipp Wiesemann a9d4a6b81a Fixed typo in source comment. 2014-08-11 23:18:35 +02:00
Philipp Wiesemann a02521492f Added javadoc comment for consistency. 2014-08-11 23:16:47 +02:00
Philipp Wiesemann 53cf64b09d Fixed doxygen warning and markdown formatting. 2014-08-11 23:13:20 +02:00
Philipp Wiesemann b33d2b7371 Updated README name in header. 2014-08-11 22:53:03 +02:00
Philipp Wiesemann 09dc9f8b20 Removed 42 from README. 2014-08-11 22:45:08 +02:00
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