Commit Graph

11015 Commits

Author SHA1 Message Date
David Ludwig
12b291f981 WinRT: made renderer init code be synchronous for now, in order to make error handling be a bit easier in the near future 2013-02-03 18:56:11 -05:00
David Ludwig
14528acc68 WinRT: fixed an odd path retrieval bug 2013-02-03 13:18:31 -05:00
David Ludwig
11f36eaddb WinRT: added a function to retrieve the root path to the installed app 2013-02-03 12:49:12 -05:00
David Ludwig
1aed239483 WinRT: made path retrieval functions return NULL on Windows Phone whenever said data isn't available 2013-02-03 12:38:55 -05:00
David Ludwig
2ef67300a3 WinRT: made path retrieval functions return wide-char strings 2013-02-03 12:34:34 -05:00
David Ludwig
7eb00a855c WinRT: use OS-native vsnprintf, which allows SDL_Log to format wide strings (via %ls) 2013-02-03 12:33:15 -05:00
David Ludwig
d839eb5eb2 WinRT: moved a bit more Direct3D 11.1 code into the SDL_Renderer backend 2013-02-02 21:05:32 -05:00
David Ludwig
4f6ffdc590 WinRT: started refactoring Direct3D 11.1 code into a new SDL_Renderer backend 2013-02-02 19:32:44 -05:00
David Ludwig
96a6361f12 WinRT: Windows Phone fixes. SDL can now display images, and respond to input, on Microsoft's Windows Phone 8 emulator. 2013-01-29 20:27:47 -05:00
David Ludwig
19e2e3294b WinRT: re-added SDL's MSVC project file, which I accidentally deleted (oops!) 2013-01-28 23:19:13 -05:00
David Ludwig
576267ca3b WinRT: added Windows Phone 8 project files, and got SDL compiling under them 2013-01-28 23:13:07 -05:00
David Ludwig
4f492c62c6 WinRT: made project file name include "WinRT", in order to make it distinct from a future WinPhone project 2013-01-28 22:03:12 -05:00
David Ludwig
e65acbfd3e WinRT: separated Win32 and WinRT project files 2013-01-23 23:42:50 -05:00
David Ludwig
7f2474a710 WinRT: made the grave/tilde key work 2013-01-23 09:51:04 -05:00
David Ludwig
cdaa0b3cd4 WinRT: got backslash keys working, at least on Win8 in a Parallels 8 VM 2013-01-23 09:09:23 -05:00
David Ludwig
a98b580312 WinRT: minor comment change to keyboard code 2013-01-23 08:45:28 -05:00
David Ludwig
b529584bec WinRT: made use of Win32 key codes if and when a documented WinRT key code can't be found 2013-01-23 08:44:12 -05:00
David Ludwig
0634d6586e WinRT: hack-fixed a bug whereby SDL_UpdateWindowSurface would fail if the app was hidden, then re-shown 2013-01-22 22:36:32 -05:00
David Ludwig
4376678d59 WinRT: minor, MSVC project file cleanup 2013-01-22 21:46:39 -05:00
David Ludwig
4d3efcce33 WinRT: added platform-specific APIs to access common, writable folder paths 2013-01-22 21:45:59 -05:00
David Ludwig
f84a7d43b1 WinRT: created sections/filters to organize the MSVC project a bit more 2013-01-22 21:05:48 -05:00
David Ludwig
0eb4cf844d WinRT: added a keyboard mapping for the Backspace key 2013-01-22 20:40:15 -05:00
David Ludwig
a254837e9e WinRT: emit SDL_WINDOWEVENT_SHOWN and SDL_WINDOWEVENT_HIDDEN 2013-01-08 23:30:21 -05:00
David Ludwig
c0cc3cec3f WinRT: converted tabs to spaces in src/video/windowsrt/* 2013-01-08 23:11:22 -05:00
David Ludwig
1fae2ee829 WinRT: send window 'minimized' and 'restored' events for app-suspend and app-resume. Use SDL_AddEventWatch() to receive these. 2013-01-08 22:50:29 -05:00
DavidLudwig
c89e8a60b2 converted tabs to spaces in iOS/UIKit PumpEvents code 2013-01-04 16:38:05 -05:00
Sam Lantinga
64ffa4ad74 Fixed bug 1679 - Error in buffer size setting in Haiku/BeOS audio driver
PulkoMandy

Just like in SDL, audio buffer sizes for BeOS and Haiku BSoundPlayer are sized
in bytes, not frames. SDL was feeding the wrong value, leading to buffers
smaller than expected and weird behaviour in some unsuspecting programs
(noticed it in HivelyTracker but others are likely affected as well. The fix is
fortunately very simple
2013-02-11 20:56:34 -08:00
Sam Lantinga
29481b26c7 Hopefully fixed the last of the C variable declaration problems which caused compile failures with Visual Studio. 2013-02-11 18:28:05 -08:00
Sam Lantinga
7f6b9c606b Fixed double-default case 2013-02-11 18:22:32 -08:00
Sam Lantinga
c0c9a2ea7d Fixed compiling SYN_DROPPED with older kernel headers 2013-02-11 18:22:17 -08:00
Sam Lantinga
cb6ecc89fb Fixed compiler warnings 2013-02-11 18:18:34 -08:00
Sam Lantinga
7d93f17562 Fixed C variable declarations 2013-02-11 18:13:52 -08:00
Sam Lantinga
84bc50080b Backed out use of @autorelease keyword for now, since it's not supported by older Xcode versions. 2013-02-11 17:40:09 -08:00
Sam Lantinga
db8271ef1a Backed out use of @autorelease keyword for now, since it's not supported by older Xcode versions. 2013-02-11 17:39:52 -08:00
Sam Lantinga
421b23644a Fixed compiler warning (and undefined behavior) in game controller event filter. 2013-02-11 17:25:58 -08:00
Sam Lantinga
fe9e22362c Workaround for NVIDIA bug in glXSwapIntervalEXT.
This works around a bug in NVIDIA's implementation of
       glXSwapIntervalEXT, where it ignores updates to what it *thinks* is the
       current value, even though glXQueryDrawable returns a different value.

       Bug reported to NVIDIA and will hopefully be a part of 319.xx.

       Also a fix for invalidly treating glXSwapIntervalEXT as having an int
       return value (it's void).
2013-02-11 17:02:13 -08:00
Sam Lantinga
643973b4d3 Patch - Joystick coef[] doesn't support dial with low number of positions.
Simon <simon@mungewell.org>

I am working on joystick support for the SRW-S1 gaming wheel on Linux,
this device has 3 dials with only a few positions each.

At present SDL2 only fail to report the highest position value, due to the
interger math used for coef[]'s.

So with a 4 position switch I have input values (with evtest)
--
Event: time 1358967246.173186, type 3 (EV_ABS), code 9 (ABS_GAS), value 2
Event: time 1358967246.173186, -------------- SYN_REPORT ------------
Event: time 1358967246.369150, type 3 (EV_ABS), code 9 (ABS_GAS), value 1
Event: time 1358967246.369150, -------------- SYN_REPORT ------------
Event: time 1358967246.930277, type 3 (EV_ABS), code 9 (ABS_GAS), value 0
Event: time 1358967246.930277, -------------- SYN_REPORT ------------
Event: time 1358967249.369832, type 3 (EV_ABS), code 9 (ABS_GAS), value 1
Event: time 1358967249.369832, -------------- SYN_REPORT ------------
Event: time 1358967249.514382, type 3 (EV_ABS), code 9 (ABS_GAS), value 2
Event: time 1358967249.514382, -------------- SYN_REPORT ------------
Event: time 1358967249.626189, type 3 (EV_ABS), code 9 (ABS_GAS), value 3
Event: time 1358967249.626189, -------------- SYN_REPORT ------------
--

Testjoystick reports
--
Joystick has 6 axes, 1 hats, 0 balls, and 17 buttons
Joystick 0 axis 5 value: 32767
Joystick 0 axis 5 value: 0
Joystick 0 axis 5 value: -32768
Joystick 0 axis 5 value: 0
Joystick 0 axis 5 value: 32767
Joystick 0 axis 5 value: 0
Joystick 0 axis 5 value: -32768
--

The attached patch 'shifts' the coef[], so that 1/2 values can be
computed/seen and allows testjoystick to report correctly.
--
Joystick has 6 axes, 1 hats, 0 balls, and 17 buttons
Joystick 0 axis 5 value: -10923
Joystick 0 axis 5 value: 10922
Joystick 0 axis 5 value: 32767
Joystick 0 axis 5 value: 10922
Joystick 0 axis 5 value: -10923
Joystick 0 axis 5 value: -32768
Joystick 0 axis 5 value: -10923
Joystick 0 axis 5 value: 10922
Joystick 0 axis 5 value: 32767
--

Cheers,
Simon
2013-02-11 16:51:00 -08:00
Sam Lantinga
51d13ff399 Fix for dropped joystick events contributed by Simon <simon@mungewell.org>
In my system SDL2 is dropping a chunk of joystick events, which result in
a 'stuck brake/accelerator' whilst playing a racing simulator. This
basically means SDL2 is unsuitable for use at this point...

The patch below detects this situation and forces a re-read of all
attached joystick axis - thus resync to the correct/current pedal
positions.
2013-02-11 16:45:24 -08:00
Sam Lantinga
f18bbe48c3 tree 97aca305664b
parent 6a9ca692cd65
author Edward Rudd <urkle@outoforder.cc> 1358030048 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030048 18000
revision 6822
branch default

rework and fix handling of hat to button mappings

- doesn't assume it's always mapped to dpad
- properly handles multiple hats (up to 4)
- properly handles multiple presses (e.g. up and right)
- properly handles multiple gamepads
2013-02-11 11:21:54 -08:00
Sam Lantinga
209207f64f tree 0c86a223596d
parent 44e12dd8ee8e
author Edward Rudd <urkle@outoforder.cc> 1358030047 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030047 18000
revision 6821
branch default

Fix a bad mapping from "axis" to "button"
2013-02-11 11:21:19 -08:00
Sam Lantinga
36788932ef tree 8cbca1e6b293
parent 7ddddb71cec9
author Edward Rudd <urkle@outoforder.cc> 1358030045 18000
committer Edward Rudd <urkle@outoforder.cc> 1358030045 18000
revision 6820
branch default

Consolidate iterating the SupportedControllers array

also fix memory leak when controller mapping not found
2013-02-11 11:20:49 -08:00
Sam Lantinga
b2bcc76cd9 Fixed building SDL under Xcode 2013-02-11 11:09:55 -08:00
Andreas Schiffler
5bda818e44 Add SDL_test test suite; add fuzzer test cases; fix fuzzer bug; fix compiler warnings 2013-02-08 07:14:50 -08:00
Sam Lantinga
9da7324da4 Fixed bug 1711 - Comment in "manifest" element within android-project/AndroidManifest.xml is the source of troubles
ny00@outlook.com

Let me quote the following opening tag from
android-project/AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    <!-- Replace org.libsdl.app with the identifier of your game, e.g.
         com.gamemaker.game
     -->
      package="org.libsdl.app"
      android:versionCode="1"
      android:versionName="1.0"
      android:installLocation="auto">

The comment (with the text "Replace org.libsdl.app with...") seems to be a
cause of troubles. Here are a few examples I've spotted:

1) While using nkd-build from android-ndk-r8d, I receive the following error:

Invalid attribute name: <!-- replace org.libsdl.app with the identifier of your
game, e.g.
         com.gamemaker.game
     --
/home/ny00123/util/android-ndk-r8d/build/gmsl/__gmsl:512: *** non-numeric
second argument to `wordlist' function: ''.  Stop.

2) Repeating this but with android-ndk-r6b (an earlier revision), it reduces to
a warning and actual complication is not halted.

3) Following the instructions in README.android and using Eclipse (from a
recently downloaded ADT Bundle), I cannot seem to be able to create an Android
project from existing sources (one of the SDL test apps for now).
* On a side note, I can't find where I may choose the "Build Target" before
clicking "Finish", but it does not seem to be related to this bug report.
Anyway, following the choice of the project path and a click on "Finish",
nothing seems to occur.
If I rather do so after removing the above comment from AndroidManifest.xml,
though, the project appears on Eclipse as expected once I click on "Finish".
2013-02-08 01:12:48 -08:00
Sam Lantinga
964388e7ee Fixed bug 1682 - Resize collapses window instantly to a size of 0 x 124.
Marco Schmidt

After sizing my main window (the only window in my application) through
grabbing the window border with the mouse the window collapses instantly to a
size of 0 x 124. In my application I can not resize the window to a normal size
again.

I tried to reproduce the problem - and here a the minimal steps I found.

I'm running WIN8 x64, VS2012Pro, HG SDL-2.0 tip, WIN32-Build.

Minimal steps to reproduce my problem:

- open solution SDL_VS2012
- make testdraw2 the start project
- pass command line option --resize to the debuggee testdraw2
- starting the application testdraw2
- try to resize the window
- the application window resizes to a minimal size 0 x 124.
- the application crashes to divide by zero .... (this is only the aftermath
but a unhandled error condition)
2013-02-08 01:04:07 -08:00
Sam Lantinga
1554db5140 Fixed bug 1689 - Leaks galore in OS X Cocoa code.
Edward Rudd

This is to document the various leaks I'm finding in the Cocoa code in SDL 2.
2013-02-08 00:54:08 -08:00
Michael Sartain
cd97f47263 Add defines to disable setlocale and fork. Disable that code by default for now. 2013-02-05 12:10:54 -08:00
Michael Sartain
0a917a7d06 Use left facing arrow instead of right facing arrow for system cursor. 2013-02-05 12:09:59 -08:00
Sam Lantinga
357652279f Use clang on Mac OS X, which is required for the @autorelease keyword 2013-02-03 14:03:49 -08:00
stopiccot
33b6a3e4a4 Replaced manual NSAutoreleasePool handing with @autorelease 2013-01-06 19:04:53 +03:00