Commit Graph

4134 Commits

Author SHA1 Message Date
Sam Lantinga
1c678cefe8 Fixed bug 1137, updated the keyboard demo with latest rendering API changes. 2011-02-20 14:22:27 -08:00
Sam Lantinga
437682d6dc Fixed testgles on iOS (bug 1136) 2011-02-20 14:16:11 -08:00
Sam Lantinga
5d2d0a1574 Fixed compiler warning 2011-02-20 13:56:57 -08:00
Sam Lantinga
ba24205a8a Fixed compiling on Mac OS X 10.4 2011-02-20 12:39:59 -08:00
Sam Lantinga
2788694b17 Simple rumble API for haptic
Edgar Simo      2011-02-20 10:27:52 PST

Adding patch that adds a simplified API for the haptic subsystem built ontop of
the "real one" for those who want simple rumble without jumping through hoops.

Adds 4 functions:

- extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
- extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
- extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float
strength, Uint32 length );
- extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);

Also provided is test/testrumble.c which does test this.

This has all been tested on linux and has worked, but due to being built ontop
of the other haptic API it should work on all OS the same.
2011-02-20 10:54:44 -08:00
Sam Lantinga
a0a3c805a2 Added a revision number for easy compile-time tests. 2011-02-20 10:42:51 -08:00
Sam Lantinga
c963d8f53b Untested fix for bug 946 (SDL_HapticIndex returns 0 for all devices)
Edgar Simo      2011-02-20 09:02:31 PST

Linux uses fname, which is the name of the device path like for example
/dev/input/event3 so it shouldn't have the issue. However I can confirm that it
looks like haptic->index never gets properly set on windows. Have to look at
mac os x also. I'll see if I can fix it real quick now.
2011-02-20 09:28:13 -08:00
Sam Lantinga
d72eb6eedc Reset the viewport since we're stretching to the entire window. 2011-02-20 09:24:02 -08:00
Sam Lantinga
8d5c5d31ab Linker and deployment target fixes for the test programs. 2011-02-19 23:39:04 -08:00
Sam Lantinga
13c5239a36 Added OpenGL state caching for decent speed improvement. 2011-02-19 21:51:21 -08:00
Sam Lantinga
d098d4f399 SDL works on older iPod Touch and first generation iPhones running iOS 3.1.3. 2011-02-19 21:51:03 -08:00
Sam Lantinga
2b98447805 Fixed linking the demos 2011-02-19 21:35:35 -08:00
Sam Lantinga
1994fb2f46 Yes, it compiles now. 2011-02-19 16:41:01 -08:00
Sam Lantinga
dda4a8e368 Fixed warning on Mac OS X 10.4 2011-02-19 14:27:16 -08:00
Sam Lantinga
8223c4bf6f Autogenerated full mask checks for pixel format match 2011-02-19 14:19:15 -08:00
Sam Lantinga
b8b0cce2e0 We have the correct window, we don't have to search for it, duh. :) 2011-02-19 11:26:49 -08:00
Sam Lantinga
3296f115b7 Added missing log debug function 2011-02-19 11:23:56 -08:00
Sam Lantinga
664f75eeff Add assertions to the default API set. 2011-02-19 11:23:41 -08:00
Sam Lantinga
402ac229d0 update-revision is still phony. :) 2011-02-18 11:23:25 -08:00
Sam Lantinga
6ec7646870 Added a better way to include build rules in the Makefile
Cleaned up dependencies on generating SDL_revision.h
Fixed 'make install' if you are not building from a Mercurial repository
2011-02-18 11:19:34 -08:00
Sam Lantinga
594e403a0f Whoops, the format parameter was off the page. 2011-02-18 09:30:09 -08:00
Sam Lantinga
6b2b174db0 The file is actually SDL_config.h now. 2011-02-17 19:00:29 -08:00
Sam Lantinga
147196ba05 Zero streaming textures to reduce confusion.
(See mailing list message with subject "Streaming textures not properly initialized?")
2011-02-17 18:58:43 -08:00
Sam Lantinga
b898d2680a Don't remove the pseudo-generated headers because this command might be run from the repo directory and it confuses people, especially if they have no way of regenerating SDL_revision.h :) 2011-02-17 18:55:56 -08:00
Sam Lantinga
573fa3a100 Fixed make install 2011-02-17 18:54:11 -08:00
Sam Lantinga
c2092ce469 Fixed debug format 2011-02-17 18:53:46 -08:00
Sam Lantinga
579f2fc55e Removed the obsolete NoSTDIO configurations 2011-02-17 12:16:01 -08:00
Sam Lantinga
b807895313 Allow the application to explicitly request a software renderer. 2011-02-17 12:03:48 -08:00
Sam Lantinga
acbbcf8bfd Our minimum Windows version is Windows 2000, so it's okay to directly call InitializeCriticalSectionAndSpinCount().. 2011-02-17 09:26:15 -08:00
Sam Lantinga
37df96b8c7 Fixed bug 1128
Patrick Baggett      2011-02-16 22:58:33 PST

This enhancement is for both x86/x64 Windows.

The SDL implementation of mutexes uses the Win32 API interprocess
synchronization primitive called a "Mutex". This implementation is subpar
because it has a much higher overhead than an intraprocess mutex. The exact
technical details are below, but my tests have shown that for reasonably high
contention (10 threads on 4 physical cores), it has 13x higher overhead than
the Win32 CriticalSection API.

If this enhancement is accepted, I will write a patch to implement SDL mutexes
using the critical section API, which should dramatically reduce overhead and
improve scalability.


-- Tech details --
Normally, Win32 Mutexes are used across process boundaries to synchronize
separate processes. In order to lock or unlock them, a user->kernel space
transition is necessary, even in the uncontented case on a single CPU machine.
Win32 CriticalSection objects can only be used within the same process virtual
address space and thus to lock one, does not require a user->kernel space
transition for the uncontended case, and additionally may spin a short while
before going into kernel wait. This small spin allows a thread to obtain the
lock if the mutex is released shortly after the thread starts spinning, in
effect bypassing the overhead of user->kernel space transition which has higher
overhead than the spinning itself.
2011-02-17 09:13:12 -08:00
Sam Lantinga
2f91270700 Implemented OpenGL ES RenderClear() 2011-02-17 02:23:48 -08:00
Sam Lantinga
834553b492 Fixed warnings about unused variables and so forth. 2011-02-17 02:18:41 -08:00
Sam Lantinga
dc6b8539ff Fixed SDL_RenderClear() if the render driver doesn't implement it. 2011-02-17 02:17:38 -08:00
Sam Lantinga
4aaf8a6795 Fixed crash when drawing non-textured primitives 2011-02-17 02:16:30 -08:00
Sam Lantinga
c45d18ec73 Updated deployment target to iPhone/iPad 3.2, and added dependencies on SDL for the demos. 2011-02-16 20:19:02 -08:00
Sam Lantinga
7390f75299 Fixed bug 1122 (spinlock fails to compile with -march=armv4t) 2011-02-16 17:17:21 -08:00
Sam Lantinga
684f838e9d There are bindings to Go at https://github.com/banthar/Go-SDL 2011-02-16 15:56:37 -08:00
Sam Lantinga
dbb0a44739 Renamed SDL_keysym.h to SDL_keycode.h to avoid confusion. 2011-02-16 15:46:12 -08:00
Sam Lantinga
b5513f44c8 Fixed bug #1090 (SDL_BlitCopyOverlap() assumes memcpy() operates in order)
Even if we're blitting between two different surfaces their pixels might still overlap, because of SDL_CreateRGBSurfaceFrom(), so always use SDL_BlitCopy() and check for overlap in that function.

When handling overlapping surfaces, don't assume that memcpy() iterates forward, instead use memmove() correctly, and provide a fallback implementation of SDL_memmove() that handles the different cases.

Fixed a bug with SDL_memset() not completely filling lengths that aren't a multiple of 4.
Optimized SDL_memcpy() a bit using the same technique as SDL_memset().
2011-02-16 15:25:10 -08:00
Sam Lantinga
74aaa6a21d The library target directly depends on SDL_revision.h 2011-02-16 14:38:49 -08:00
Sam Lantinga
03aaebb738 Updated to remove stdio redirect option 2011-02-16 14:35:38 -08:00
Sam Lantinga
db51534426 Fixed SDL_revision.h dependencies 2011-02-16 13:02:37 -08:00
Sam Lantinga
c6e3f767cc Source is not executable... 2011-02-16 12:52:09 -08:00
Sam Lantinga
349a9bf3ce Allow you to override SDL's main override 2011-02-16 12:27:29 -08:00
Sam Lantinga
e3883e9792 The scripts to generate header files are no longer necessary. 2011-02-16 12:15:04 -08:00
Sam Lantinga
6e4e39c100 Updated HG ignore file for Visual C++ files 2011-02-16 05:00:33 -08:00
Sam Lantinga
4e23998953 Fixed bug #1121 (More than one device through SDL_JOYSTICK_DEVICE)
Chusslove Illich      2011-02-13 04:30:28 PST

Currently SDL_JOYSTICK_DEVICE environment variable can be used to add
exactly one topmost device. I think it would be nice if one could also set
several devices (e.g. a stick and a throttle) in this way, as a colon-
separated list. The attached patch implements this
2011-02-16 04:51:13 -08:00
Sam Lantinga
d3919b512d Fixed bug #1085 (Jump to NULL function pointer on ALSA_OpenDevice)
Bruno      2010-12-16 02:41:51 PST

Fix segfault in ALSA_OpenDevice()

When alsa is linked to libsdl instead of being loaded on demand at runtime the
alsa macro snd_pcm_hw_params_alloca(ptr); misbehaves.

That macro calls snd_pcm_hw_params_sizeof() in order to determine the amount of
memory to allocate but due to mis-placed define that function is replaced with
ALSA_snd_pcm_hw_params_sizeof by preprocessor (and in case of link to alsa that
function pointer is initialized to itself).

Attached patch fixes the issue.
2011-02-16 04:08:28 -08:00
Sam Lantinga
305a0b92b2 Fixed bug #1064 (configure still has --enable-stdio-redirect option) 2011-02-16 03:59:39 -08:00
Sam Lantinga
7537a3d9e3 Setup the screensaver in the OpenGL case as well. 2011-02-16 02:57:00 -08:00