Commit graph

3900 commits

Author SHA1 Message Date
Sam Lantinga
250faf507b Added Edgar's blog to the haptic documentation 2011-01-28 12:09:25 -08:00
Sam Lantinga
48e11c3665 Updated main.c for API changes
Kees Bakker to sdl

The main.c for the template is still targeting SDL1.2. Here
is the patch to make it work for SDL1.3 (I'm hoping
the mailing lists accepts attachments.)

In this patch I have also changed the shell script that
assembles the Template. Since there is now only one lib
target (same name for "device" and "simulator" version)
I copy the simulator library to the destination with
the name libSDLSimulator.a. This is not a satisfactory
solution, because both libraries are included in the project
while only one is needed (depending on the selected
environment). However, I'm not fluent with Xcode to
say what a better solution would be.

Kind regards,
Kees Bakker
2011-01-28 10:37:36 -08:00
Sam Lantinga
e64d0e8d85 Fixed bug #1056 (Frequent crashes in Touch events by simply touching the screen)
Joseba García Echebarria      2010-12-15 01:55:22 PST

I believe the crash is caused by a check not being performed on wether an
SDL_Touch element is NULL before using it in the SDL_SendTouchMotion function
in src/events/SDL_touch.c around line 400.
Judging from the rest of the code, there's a missing

    if (!touch) {
        return 0;
    }

before using "touch" as SDL_GetFinger(), SDL_GetFingerIndexId() use
touch->num_fingers without checking.

I can attach a patch if you like. It seems pretty straightforward, though.

I have yet to discover why touch is being returned as NULL as this error is
only triggered when an actual gesture has been performed, maybe something
related to SDL_AddTouch()?
2011-01-28 10:21:58 -08:00
Sam Lantinga
c3daf0f0cd Removed completely non-portable event thread hack.
Next I'll be working on generalizing the event sources and making the event queue lock-free. :)
2011-01-27 22:44:08 -08:00
Sam Lantinga
95dbe47cf3 Fixed test 2011-01-27 20:51:54 -08:00
Sam Lantinga
858c92ff35 Added CPU cache line size to the test output. 2011-01-27 20:49:07 -08:00
Sam Lantinga
b2ff9dc39f Added API function to get CPU cache line size. 2011-01-27 20:46:45 -08:00
Sam Lantinga
b0a2a8957e Fixed quotes around Mercurial revision text 2011-01-27 20:37:54 -08:00
Sam Lantinga
7d33cf09be 0 isn't a valid Mercurial revision 2011-01-27 20:14:10 -08:00
krogoway
7f1b3595cc Always copy the SDL_config_windows.h to SDL_config.h for VisualC 2005, 2008 and 2010 projects. 2011-01-27 20:30:39 -06:00
Sam Lantinga
772009b691 Bump up the default cache line size. 2011-01-27 16:51:47 -08:00
Sam Lantinga
fb824f9a04 Added cache line size info in SDL_cpuinfo.h
I also added an implementation to dynamically query it, but didn't expose it since most x86 CPUs have an L1 cache line size of 64 bytes.
2011-01-27 16:46:15 -08:00
Sam Lantinga
1d518f0d73 Fixed compiling under Visual Studio 2011-01-27 15:31:00 -08:00
krogoway
e253e1d991 When the last window is closed and the SDL_WINDOWEVENT_CLOSE event is sent, send the SDL_QUIT event.
Common.c now destroys the SDL_Window upon a SDL_WINDOWEVENT_CLOSE event to ensure that all windows get closed properly and the new code to handle the last window closes gets executed.
2011-01-27 15:58:30 -06:00
Sam Lantinga
be54c8a0d5 This patch fixes the issue of configure generating broken Makefile
when .cc files are used due to bad sed substitution on multiple passes:
$(objects)/SDL_BeApp.lo:
$(objects)/SDL_BeApp.lo: ./src/main/beos/SDL_BeApp.c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS)  -c $< -o $@c
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS)  -c $< -o $@

Signed-off-by: François Revol
2011-01-27 14:54:20 -08:00
Sam Lantinga
dd4f2c1339 Improved timer implementation
The new timer model is formalized as using a separate thread to handle timer callbacks.  This was the case on almost every platform before, but it's now a requirement, and simplifies the implementation and makes it perform consistently across platforms.

Goals:
 * Minimize timer thread blocking
 * Dispatch timers as accurately as possible
 * SDL_AddTimer() and SDL_RemoveTimer() are completely threadsafe
 * SDL_RemoveTimer() doesn't crash with a timer that's expired or removed
2011-01-27 14:45:06 -08:00
Sam Lantinga
2fd57ffe61 Improved condition variable documentation 2011-01-27 10:40:17 -08:00
Sam Lantinga
86e36cceab Scott Smith volunteered to maintain the Pandora port. 2011-01-27 10:07:14 -08:00
Sam Lantinga
1bdfc84ec9 Fixed bug #1109
Ozkan Sezer      2011-01-26 12:33:42 PST

I got warnings from SDL_windowskeyboard.c when I compiled for win64.
2011-01-27 08:40:06 -08:00
Sam Lantinga
e2a13f8922 Only document the public API, not the whole source tree. 2011-01-27 07:05:13 -08:00
Sam Lantinga
b58487d8bb Colin Leroy 2011-01-26 04:24:20 PST
the pthread implementation of SDL_SemWaitTimeout() uses busy waiting, while
pthread's sem_timedwait() does work. Attached are patches that make use of it
2011-01-27 00:34:12 -08:00
Sam Lantinga
71a8858bd9 Added a list of platforms, for my own sanity. :) 2011-01-27 00:19:46 -08:00
Sam Lantinga
d06966d7f2 Nobody is maintaining RISC OS code, so I'm removing it for now. 2011-01-27 00:06:36 -08:00
Sam Lantinga
9b3ce56bfd Since we're directly reading and writing 'active' from different threads, it needs to be flagged volatile. 2011-01-26 19:20:16 -08:00
Sam Lantinga
9edcf9bc9b Ozkan Sezer to slouken
The attached small patch updates SDL's libtoolized files for
pe-x86_64 magic, ie win/x64.
2011-01-26 12:23:32 -08:00
Sam Lantinga
b609519a5c Added a test to measure the impact of a separate thread periodically locking the queue entirely. 2011-01-26 00:03:34 -08:00
Sam Lantinga
bbc1ba223a Added a FIFO test to the atomic test suite.
This is really useful because we might be able to use something like this
for the SDL event queue.
2011-01-25 23:23:52 -08:00
Sam Lantinga
fc5dc0ddb2 More fixes for compilation on Visual Studio 2011-01-25 18:02:41 -08:00
Sam Lantinga
81dee4358f Fixed compile error on Visual C++ 2011-01-25 17:44:17 -08:00
Sam Lantinga
29e0bf97e0 Improvements based on feedback from Anthony Williams 2011-01-25 17:40:06 -08:00
krogoway
c8cd5b9028 Added SDL_window.* to the project. 2011-01-24 23:54:21 -06:00
Sam Lantinga
7327ef6bb9 Fixed cross-compiling for Windows 2011-01-24 21:41:36 -08:00
Sam Lantinga
ada074623f Fixed Android build 2011-01-24 21:31:32 -08:00
Sam Lantinga
f98d804282 Only include windows.h on Windows. :) 2011-01-24 21:22:00 -08:00
Sam Lantinga
b4497865bd Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
I think this also fixes the bug relating to non-latin characters in filenames, since UNICODE wasn't defined in SDL_rwops.c

--HG--
rename : src/SDL_android.cpp => src/core/android/SDL_android.cpp
rename : src/SDL_android.h => src/core/android/SDL_android.h
2011-01-24 21:20:30 -08:00
Sam Lantinga
1775cf40fd Fixed bug #1102
Check /usr/local/bin for hg before sourcing the user's bash settings
2011-01-24 17:47:18 -08:00
Sam Lantinga
065e4e3f9d Fixed bug #1100
Test the video features with #if instead of #ifdef
2011-01-24 17:38:18 -08:00
Sam Lantinga
d5b9e9676a Fixed bug #1103
The SDL_blendmode.h and SDL_scalemode.h headers needed to be added to the Public Headers and all the public headers need to have the "Public" role set.
2011-01-24 16:10:13 -08:00
Sam Lantinga
10b8372bd3 Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008 2011-01-24 15:46:11 -08:00
Sam Lantinga
b33881a48e Fixed compile error 2011-01-24 15:10:16 -08:00
Sam Lantinga
c330005880 Fixed bug #1080
Markus Rathgeb      2011-01-23 14:34:23 PST

With kernel 2.6.31 the struct input_absinfo defined in linux/input.h changed.
A field "__s32 resolution" was added at the end of the struct.

Because the macro EVIOCGABS(abs) is using the struct input_absinfo, it would be
better (IMHO) to change the declaration of variable values to
"int values[sizeof(struct input_absinfo) / sizeof(int)];" or using "struct
input_absinfo" directly.
2011-01-24 14:36:12 -08:00
krogoway
a2f2302255 Renamed SDL_keysym to SDL_KeySym
Renamed SDL_scancode to SDL_ScanCode
Added #defines to SDL_compat.h
2011-01-24 13:47:35 -06:00
Sam Lantinga
477689ac83 Fixed bug #1011
Daniel Ellis      2010-06-25 15:20:31 PDT

SDL based applications sometimes display the wrong application name in the
Sound Preferences dialog when using pulseaudio.

I can see from the code that the SDL pulse module is initiating a new pulse
audio context and passing an application name using the function
get_progname().

The get_progname() function returns the name of the current process. However,
the process name is often not a suitable name to use. For example, the OpenShot
video editor is a python application, and so "python" is displayed in the Sound
Preferences window (see Bug #596504), when it should be displaying "OpenShot".

PulseAudio allows applications to specify the application name, either at the
time the context is created (as SDL does currently), or by special environment
variables (see http://www.pulseaudio.org/wiki/ApplicationProperties). If no
name is specified, then pulseaudio will determine the name based on the
process.

If you specify the application name when initiating the pulseaudio context,
then that will override any application name specified using an environment
variable.

As libsdl is a library, I believe the solution is for libsdl to not specify any
application name when initiating a pulseaudio context, which will enable
applications to specify the application name using environment variables. In
the case that the applications do not specify anything, pulseaudio will fall
back to using the process name anyway.

The attached patch removes the get_progname() function and passes NULL as the
application name when creating the pulseaudio context, which fixes the issue.
2011-01-23 21:55:04 -08:00
Sam Lantinga
f3716d8a4e Fixed size_t warnings on 64-bit build 2011-01-22 15:58:21 -08:00
Sam Lantinga
dcd48df016 Fixed bug in timer when the list of timers changed.
Fix contributed by Michael Bicha
2011-01-22 00:33:37 -08:00
Sam Lantinga
c4bf458e47 Fixed bug #1097
There are problems with including intrin.h in C linkage in C++ compilation,
and further conflicts between intrin.h and winnt.h on Visual Studio 2005.
2011-01-21 23:46:51 -08:00
Ryan C. Gordon
14a0cb6fbc Whitespace change in a README. 2011-01-22 03:57:27 -05:00
Sam Lantinga
daecbfdc17 HAVE_GCC_ATOMICS covers the test and set 2011-01-21 21:45:55 -08:00
Sam Lantinga
b3e14d4341 Yeah, go iPhone! 2011-01-21 21:43:56 -08:00
Sam Lantinga
2c31531800 Separated out the minimum functionality that we need from gcc for our spinlock fallback. 2011-01-21 21:42:04 -08:00