Commit Graph

455 Commits (53e22e4be8c462f15f31c9c906a412fcefd731cf)

Author SHA1 Message Date
Sam Lantinga 53e22e4be8 Only use GCC pragmas when we're building with GCC 2016-10-01 11:22:39 -07:00
Sam Lantinga a42c396a57 Fixed bug 3361 - Texture color modulation doesn't work with active NONE blend mode (opengl and opengles)
Simon Hug

The GL_SetBlendMode and GLES_SetBlendMode functions of the opengl and opengles renderers call the glTexEnvf to set the texture env mode to either GL_MODULATE (the default) or GL_REPLACE for the NONE blend mode. Using GL_REPLACE disables color and alpha modulation for textures.

These glTexEnv calls were put in the SetBlendMode function back in 2006 [1], but there the NONE code still used the GL_DECAL mode. The GL_REPLACE mode came in 2008 [2]. I'm a bit confused why that wasn't always GL_MODULATE and a bit surprised nobody reported that yet (unless I missed it). I guess only a few use the gles renderer and the newish shaders mask the issue.
2016-10-01 11:04:45 -07:00
Sam Lantinga 3f1b1629c4 Fixed bug 3362 - OpenGL renderer doesn't check if framebuffers are supported when creating target textures
Simon Hug

The GL_CreateTexture function doesn't have any checks for the case where the driver doesn't support the framebuffer object extension. It will call into GL_GetFBO which will call the non-existent glGenFramebuffersEXT.

Also, for some reason GL_CreateContext always sets the SDL_RENDERER_TARGETTEXTURE info flag, even if it is not supported. Changeset cc226dce7536 [1] makes this change, but doesn't explain why. It seems to me like the code would already have taken care of this [2].

The attached patch adds some checks and stops SDL from reporting render target support if there is none. The application can then properly inform the user instead of just crashing.
2016-10-01 10:52:24 -07:00
Sam Lantinga fd1d692bef Fixed bug 3368 - SDL_Blit_Slow doesn't ignore alpha values in colorkey comparison
Simon Hug

When the SDL_Blit_Slow function compares the pixel to the color key it does so without removing the alpha component from the pixel value and the key. This is different from the optimized 32-bit blitters which create a rgb mask and apply it to both to filter the alpha out. SDL_Blit_Slow will only skip the pixels with the exact alpha value of the key instead of all pixels with the same color.

The attached test case blits a surface with a color key and prints the pixel values to the console. The third row is expected to be skipped.
2016-10-01 10:46:10 -07:00
Sam Lantinga 2ccb46cebc Fixed bug 3373 - OpenGL implementation differences of glDrawTexfOES
Simon Hug

It seems not everyone implemented glDrawTexfOES the same. Intel and Mesa ignore the viewport entirely, whereas the Raspberry Pi implementation offsets the coordinates and does viewport clipping.

The glDrawTexfOES extension text [1] for the function says "Xs and Ys are given directly in window (viewport) coordinates." I guess this wasn't clear enough.

Alex Szpakowski

Honestly I'd probably remove that codepath from SDL_Render entirely. It's an OpenGL ES 1-specific extension that isn't likely to give huge performance gains and adds additional maintenance overhead to SDL_Render while also having bugs in some drivers (as seen here).
2016-10-01 10:43:01 -07:00
Sam Lantinga 9dfe54006e We should be using a string constant for the strftime format string 2016-10-01 10:38:15 -07:00
Bastien Nocera 7edd2261e7 Fix "format not a string literal" errors
With GCC 6.1.

https://bugzilla.libsdl.org/show_bug.cgi?id=3375
2016-10-01 10:36:24 -07:00
Jonathan Dowland 461336a23e Add gamecontrollerdb lines for SFC30 controller in various modes
SFC30 controller: http://www.8bitdo.com/sfc30/

The SFC30 controller can present itself in a variety of modes and it offers up
different names in each. This patch captures data for three modes (one USB and
two Bluetooth) on three platforms (Mac OS X, Windows, Linux).

However, USB mode on Linux and Windows is missing as the button events did not
make it through to SDL's controllermap tool on Fedora 24/Linux 4.5.5 nor Steam
Big Picture mode on Windows. The two Bluetooth modes were indistinguishable on
Windows. Two modes on OS X were indistinguishable.

There exists a similar controller called the SNES30 (And some others) that are
very likely identical except for the name, but I have not verified this yet so
haven't synthesized lines for those controllers until I can.
2016-07-01 16:47:27 +01:00
Sam Lantinga b7e45f8a1a Fixed bug 3336 - Failure to build with MinGW-w64
Kai Sterker
There are already patches available from mingw64 that fix the issue

https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-SDL2

With those applied, I could compile SDL2 without problems. But of course, it would be preferable if SDL built cleanly from source.
2016-10-01 10:28:00 -07:00
Sam Lantinga 9f854cdbe0 Fixed bug 3388 - Fail to build src/thread/windows/SDL_systhread.c on MinGW 4.9.3
Vitaly Novichkov

Line 124
====================================================================
const DWORD flags = thread->stacksize ? STACK_SIZE_PARAM_IS_A_RESERVATION : 0;
====================================================================

Error of compiler:
====================================================================
  CC     build/SDL_systhread.lo
src/thread/windows/SDL_systhread.c: In function 'SDL_SYS_CreateThread':
src/thread/windows/SDL_systhread.c:124:45: error: 'STACK_SIZE_PARAM_IS_A_RESERVA
TION' undeclared (first use in this function)
     const DWORD flags = thread->stacksize ? STACK_SIZE_PARAM_IS_A_RESERVATION :
 0;
                                             ^
src/thread/windows/SDL_systhread.c:124:45: note: each undeclared identifier is r
eported only once for each function it appears in
make: *** [build/SDL_systhread.lo] Error 1
====================================================================

Fixing when I adding into begin of the file:
====================================================================
#ifndef STACK_SIZE_PARAM_IS_A_RESERVATION
#define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
#endif
====================================================================
2016-10-01 10:08:34 -07:00
Philipp Wiesemann 7b23eef3b0 Fixed crash if allocating memory for mouse clicks failed. 2016-09-30 23:30:54 +02:00
Ryan C. Gordon e64c5186e2 windows: Removed hardcoded "1" for mouse clickthrough hint. 2016-09-29 23:42:18 -04:00
Ryan C. Gordon f10db4071d haiku: Patched to compile. 2016-09-29 23:15:56 -04:00
Ryan C. Gordon f2fcd324c5 windows: fix borderless windows at desktop resolution (thanks, Evgeny!).
Fixes Bugzilla #3404.
2016-09-29 23:12:58 -04:00
Ryan C. Gordon b2510d9cbc x11: fixed incorrect SDL_GetWindowPosition() after resize (thanks, Jason!).
Fixes Bugzilla #3272.
2016-09-29 23:01:43 -04:00
Ryan C. Gordon 4f4c4b629f Added SDL_SetWindowResizable(). (thanks, Ethan!) 2016-09-29 22:52:41 -04:00
Sam Lantinga f1e0b9af20 Added debug output for new window events 2016-09-29 16:10:08 -07:00
Sam Lantinga 67bdbcca44 Implemented SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH on X11 2016-09-29 16:05:29 -07:00
Sam Lantinga d285af2a96 Added Windows support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH 2016-09-29 14:48:33 -07:00
Sam Lantinga a13da2faa7 Generalized the hint for whether the application gets a mouse event when clicking on the window to activate it, and is now named SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH.
The behavior is defined to not receive the click event, and this hint allows you to override that.
2016-09-29 13:34:49 -07:00
Sam Lantinga 8ddb4328b5 When clicking on a window to give it focus, don't pass the mouse click to the application. 2016-09-29 03:59:04 -07:00
Sam Lantinga e45698d218 Updated version to 2.0.5 in preparation for release 2016-09-28 22:24:01 -07:00
Alex Szpakowski f31c7086d8 Enable SDL_LoadObject on iOS 8+ and tvOS. 2016-09-25 15:02:06 -03:00
Alex Szpakowski 77bacfd72d tvOS launch images are now properly supported. 2016-09-25 11:46:25 -03:00
Alex Szpakowski 40ecac8e60 Don't try to load a launch storyboard on tvOS (it doesn't use them). 2016-09-25 00:21:12 -03:00
Alex Szpakowski 666d3fecc8 iOS/tvOS: Try to load the launch screen as a storyboard. Xcode 8 compiles it as a storyboard instead of a nib. 2016-09-24 23:33:49 -03:00
Alex Szpakowski 9165ba7ebd iOS/tvOS: Always send SDL_WINDOWEVENT_FOCUS_GAINED when a window is created on the main screen (fixes bug #3395). 2016-09-24 20:12:57 -03:00
Alex Szpakowski 450fa8cdf9 Use OS-provided click counts on macOS and iOS for mouse press and release events. 2016-09-24 18:46:34 -03:00
Alex Szpakowski bac5394127 Fix mouse wheel events on macOS 10.12 (thanks Eric Wasylishen!)
Fixes bug #3432
2016-09-24 13:28:40 -03:00
Brandon Schaefer 89c538a4e3 Mir: Add gamma support set/get. Still need one more function to complete the set 2016-09-21 18:23:59 -07:00
Brandon Schaefer a729c4f97a Mir: Add fixme (waiting for a public api to be added) 2016-09-21 16:28:23 -07:00
Brandon Schaefer 705ecf78f5 [Mir] Move to the new MirDisplayConfig API 2016-09-21 15:57:15 -07:00
Philipp Wiesemann 8e88f08150 Mac: Fixed whitespace around function return type. 2016-09-21 23:06:49 +02:00
Philipp Wiesemann 85588ea040 Android: Fixed two warnings about unused variables. 2016-09-21 23:06:26 +02:00
Alex Szpakowski f0fca2880f Handle audio interruptions on iOS/tvOS. Fixes bugs 2569 and 2960. 2016-09-18 19:22:09 -03:00
Ryan C. Gordon 06700a905b emscripten: get even more aggressive about audio device closing.
I still get exceptions thrown sometimes on shutdown without this.
2016-09-18 18:07:47 -04:00
Sam Lantinga 29214826ec Fixed warning with Xcode 7.3.0 2016-09-16 22:27:58 -07:00
Alex Szpakowski a96b6f2104 Added a new hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION.
When set to "1", the orientation of the Apple TV remote affects the axes of the corresponding SDL joystick. It is "0" (disabled) by default.
2016-09-17 01:31:07 -03:00
Alex Szpakowski 4bcce330d1 tvOS: Add drop-file support 2016-09-15 21:49:29 -03:00
Alex Szpakowski 4209a1fd4c CoreAudio iOS/tvOS: Use AVFoundation instead of AudioSession. Fixes audio on tvOS.
Note that linking with AVFoundation is now required if you don't disable SDL_audio compilation on iOS and tvOS.
2016-09-15 19:59:57 -03:00
Sam Lantinga 86d4b09914 Fixed spacing 2016-09-13 18:44:28 -07:00
Sam Lantinga 925859aaa6 Fixed accidental call to SDL_PrivateJoystickHat() 2016-09-13 18:43:55 -07:00
Alex Szpakowski f050576665 Initial Apple TV / tvOS support.
The Apple TV remote is currently exposed as a joystick with its touch surface treated as two axes. Key presses are also generated when its buttons and touch surface are used.

A new hint has been added to help deal with deciding whether to background the app when the remote's menu button is pressed: SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.
2016-09-13 22:18:06 -03:00
Alex Szpakowski 86708c3cd8 Enable more compiler warnings in the Xcode projects (based on Xcode 8's suggestion), made some integer downcasts explicit. 2016-09-13 19:51:10 -03:00
Sam Lantinga 00791f3a87 Only prevent the default browser event handling when the specific event types aren't disabled by the user, patch contributed by Jonas Platte 2016-09-13 00:09:21 -07:00
Charlie Birks 993dd83510 Add mapping for media keys 2016-09-13 00:04:00 -07:00
Alon Zakai 1b6565fcb7 use Module.createContext for 2D rendering in emscripten 2016-09-13 00:03:59 -07:00
Alon Zakai bec5573476 add some detail to fullscreen workaround comment; version 6
Conflicts:
	version.txt
2016-09-13 00:03:58 -07:00
Charlie Birks 405d64b207 only unset fullscreen flags if fullscreen failed 2016-09-13 00:03:56 -07:00
Charlie Birks c68cac89df use screen resolution instead of canvas size 2016-09-13 00:03:55 -07:00