Commit Graph

7503 Commits

Author SHA1 Message Date
Sam Lantinga e19f15ddd5 Fixed bug 2067 - Window size limit calculation issue when exiting fullscreen on Windows
Also fixed minimize and maximize state detection for Windows.
2013-11-10 14:10:00 -08:00
Sam Lantinga b7553ae77e Added project files for Visual Studio 2013
Added /arch:SSE code generation option to prevent SSE2 floating point functions from being implicitly called (which aren't linked in SDL)
2013-11-10 11:51:06 -08:00
Philipp Wiesemann 842a9898ce Fixed joystick crash on Android if joystick subsystem not initialized. 2013-11-10 17:50:40 +01:00
Philipp Wiesemann 305f64ba2e Replaced search loop with indexOf() in Java file. 2013-11-10 17:44:51 +01:00
Philipp Wiesemann bbf0f62be9 Replaced implicit boxing with explicit boxing in Java file. 2013-11-10 17:42:01 +01:00
Philipp Wiesemann 2d67178149 Renamed a class in Java file for consistency. 2013-11-10 17:40:26 +01:00
Philipp Wiesemann 802f83ff99 Removed not needed imports from Java file. 2013-11-10 17:38:03 +01:00
Philipp Wiesemann d6c1e3812e Added missing @Override annotations in Java file. 2013-11-10 17:35:07 +01:00
Philipp Wiesemann 26ce68e8c2 Changed motion listener implementation not to inherit from Activity class. 2013-11-10 15:04:58 +01:00
Philipp Wiesemann fda8d93440 Moved two function calls so they are only called if needed.
If the MotionEvent is not from joystick the return values are not needed.
2013-11-10 14:58:48 +01:00
Philipp Wiesemann aa3379802b Added a new unused key code from Android 4.4 (API 19). 2013-11-10 14:50:37 +01:00
Philipp Wiesemann 0ab7624cde Changed function to return -1 through SDL_Error() instead of plain -1. 2013-11-10 14:47:05 +01:00
Philipp Wiesemann 82b3e7d229 Changed function to be static.
The function keycode_to_SDL() is only used in this file.
2013-11-10 14:44:50 +01:00
Philipp Wiesemann 6e3558cf99 Removed unused local variable to fix warning. 2013-11-10 14:42:41 +01:00
Philipp Wiesemann 3f2e942fa0 Fixed implicit function declarations by including the missing header. 2013-11-10 14:39:38 +01:00
Philipp Wiesemann bd1e1a93f2 Corrected source comment. 2013-11-10 14:36:41 +01:00
Ryan C. Gordon 92b12812ac Added Ben Henning's GSoC2013 work: premake build system. 2013-11-10 00:38:37 -05:00
Ryan C. Gordon 5206975778 Added Apoorv Upreti's GSoC2013 work: visual test suite.
See visualtest/README.txt for details.
2013-11-10 00:32:23 -05:00
Sam Lantinga 247313174a Updated notes about building with the Windows 8 SDK: Get the DirectX SDK. 2013-11-09 01:15:17 -08:00
Sam Lantinga 33cf925c15 Fixed signed/unsigned warning 2013-11-09 01:08:21 -08:00
Sam Lantinga 550676d08d Fixed signed/unsigned warning 2013-11-09 00:56:05 -08:00
Sam Lantinga 976c876924 Fixed bug 2172 - Window loses maximized state when activated
I still haven't figured out why my application is being minimized when I try to raise, it but my previous workaround is causing issues.

For now the correct way to raise and/or restore the window is as follows:

	if ( !(SDL_GetWindowFlags( window ) & SDL_WINDOW_MINIMIZED) )
	{
		SDL_RaiseWindow( window );
	}
	if ( SDL_GetWindowFlags( window ) & SDL_WINDOW_MINIMIZED )
	{
		SDL_RestoreWindow( window );
	}

I will investigate the window state change rules more fully in the future.

CR: Alfred Reynolds
2013-11-08 14:05:23 -08:00
Sam Lantinga 7c7a9b7f89 Added a Linux game controller mapping for the Valve Streaming Gamepad 2013-11-08 14:05:19 -08:00
Sam Lantinga 3523b409bc Made helper window creation depend on initializing the Haptics or Joystick subsystems. 2013-11-08 14:05:15 -08:00
Sam Lantinga faebe94c56 Mac: Fix a crash with SDL_MAC_NO_SANDBOX.
When we get a kCGEventTapDisabledByTimeout or
kCGEventTapDisabledByUserInput, the event tap would perform an invalid
memory access. void pointers are so fun.

This code only runs if you explicitly build with SDL_MAC_NO_SANDBOX.
2013-11-08 14:05:08 -08:00
Sam Lantinga e3e24bded7 Make sure the joystick count is correct when the added and removed events are dispatched, in case someone is watching for them with an event filter. 2013-11-08 14:04:59 -08:00
Sam Lantinga 621c7f8f1f 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
Sam Lantinga 493fadd5c1 Fixed spot where SDL was assuming that two displays having the same origin means they're the same display. Changed it to check for the same extents instead.
(Sam actually wrote this, I'm just reviewing and checking it in.)
2013-11-08 14:04:35 -08:00
Sam Lantinga 95c67ed9a7 Fixed bug 2219 - BMP loader do not handle big BITMAPINFOHEADER structure
Patrice Mandin

I encountered a problem trying to load a 8-bit paletted BMP file using SDL. This file was generated using GIMP 2.8. It has a big BITMAPINFOHEADER (0x6c bytes for biSize field), and thus the palette is incorrectly setup.
2013-11-07 19:15:58 -08:00
Sam Lantinga 48e44f7fcb Fixed Windows compile error 2013-11-06 23:59:24 -08:00
Sam Lantinga 3b050fc953 Horizontal wheel support in windows
Lorenzo Pistone

this patch adds support for the horizontal wheel in Windows. It is shamelessly copied off the vertical wheel code, but I guess that that is a value added in consistency.
2013-11-06 23:35:08 -08:00
Gabriel Jacobo 22770a8f40 [Android] Fixes Bug 2041 - can't get SDL_QUIT event...
Thanks to Denis Bernard!

Also, changed the Android manifest so the app doesn't quit with orientation
changes, and made testgles.c exit properly on Android.
2013-11-06 11:23:24 -03:00
Gabriel Jacobo e27248c27e Fixes Bug 1944 - Linux events, joysticks having only hat are not read 2013-11-06 09:48:45 -03:00
Sam Lantinga 1c9cc8c9b7 Fixed performance regression caused by the fix for bug 2158 2013-11-05 21:01:25 -08:00
Gabriel Jacobo 0b7c69fe12 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 749117acd9 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 61068a30b6 Fixed bug 2180 - debian/rules: Makefiles should use tabs
Joseph Carter

Whitespace in a makefile is consequential.  In fact, it's part of the syntax.  And at least a few versions of make puke on Makefiles with lines indented with spaces, not tabs.  Obviously GNU make used on Debianish systems is not strictly among them, or this would fail.  Even so, I cannot resist the urge to pedantically fix this, if only to get rid of the bright syntax error red coloration in vim.  :)
2013-11-03 11:34:03 -08:00
Sam Lantinga c4b563e4c3 Fixed bug 2190 - test/testdrawchessboard.c line endings
Joseph Carter
test/testdrawchessboard.c checks out of hg with DOS line endings on non-dos systems.  Fixed via:

perl -pi -e 's/\r//g' test/testdrawchessboard.c
2013-11-03 11:27:06 -08:00
Sam Lantinga 517886a7f1 Fixed bug 2205 - SDL_GetAudioDeviceName returns default-device name on invalid index for default-device only drivers
norfanin

The audio_enumerateAndNameAudioDevicesNegativeTests test in testautomation_audio.c reports a failure for SDL_GetAudioDeviceName when called on a driver that has only the default device. SDL_GetNumAudioDevices reports 1, but SDL_GetAudioDeviceName does not check if the index passed by the caller is in that range in this case. For positive numbers anyway.

This can be reproduced with the dummy driver on Windows and Linux.
2013-11-03 11:13:06 -08:00
Sam Lantinga aaa4165b9f Fixed bug 2187 - CMake is not adding src/core/linux/*.c to the build, linking to SDL results in errors.
Daniel Ribeiro Maciel

CMake is not adding src/core/linux/*.c to the build, linking to SDL results in errors:

(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_AddCallback'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_Poll'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_Init'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_Quit'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_DelCallback'
(...)/libSDL2-2.0.so.1.0.1: undefined reference to `SDL_UDEV_Scan'
collect2: error: ld returned 1 exit status
2013-11-03 11:00:28 -08:00
Sam Lantinga f2224e1fc7 Fixed bug 1990 - focus/keyboard events not generated correctly for multiple windows
Mai Lavelle

I've recently tried to create multiple windows and process key events for them, and found that key events weren't being generated for most of the windows. After some investigating I've observed the following effects. All but the most recently created window experience these effects...

- a focus lost event is generated immediately after the focus gained event, even tho window still has focus
- key events report window id 0 rather than the id of the window which has focus, SDL thinks no window has focus?
- giving focus to a non SDL window and then selecting an SDL window causes events to be generated as expected, but only until focus changes again

Focus change events are queued and delayed (200 ticks) before they are dispatched.  The problem occurs when a focus out and focus in event are received on the same tick.  When these delayed events are dispatched they will be sent in the order determined by the window list rather than the order in which they are received.

The focus out dispatch is implemented by calling SDL_SetKeyboardFocus(NULL).  This will remove focus from any window, regardless of whether it is the one originally targeted by the X11 event.

Since SDL_SetKeyboardFocus() will always dispatch a focus lost event as needed, the easiest solution is simply to only call SDL_SetKeyboardFocus(NULL) when SDL_GetKeyboardFocus() matches the target window.
2013-11-03 09:55:27 -08:00
Sam Lantinga 2efd40652d Clarified that SDL_memset4 is a 32-bit assignment and fixed a compiler warning 2013-11-03 09:42:23 -08:00
Philipp Wiesemann cd37485e3c Changed parameter name for gesture template save functions from "src" to "dst". 2013-11-02 12:07:21 +01:00
Philipp Wiesemann 95bbf5f443 Removed unreachable return statement in gesture source. 2013-11-02 11:51:23 +01:00
Philipp Wiesemann 4e270de15d Changed function to return -1 through SDL_Error() instead of plain -1. 2013-11-02 11:46:43 +01:00
Philipp Wiesemann 0f8d9995fe Corrected typo in source comment. 2013-11-02 11:42:00 +01:00
David Ludwig 7cc0951637 WinRT: added support for SDL_HINT_RENDER_SCALE_QUALITY 2013-11-01 22:54:39 -04:00
Gabriel Jacobo e651ab12b6 Fixes Bug #2191,incorrect test for egl_context validity
Thanks David Binderman!
2013-10-31 10:02:21 -03:00
Ryan C. Gordon 804e5799ad Fixed common test usage string (was "hidpi", should be "highdpi"). 2013-10-30 16:39:35 -04:00
Ryan C. Gordon d36c7363dd Updated GL version tests for Mac OS X 10.9 ("Mavericks").
They changed the name of their GL 3.2 enum, added the GL 4.1 core profile.
2013-10-28 22:43:39 -04:00