Commit graph

2622 commits

Author SHA1 Message Date
Darren Alton
c50bab2ba9 NDS compiles again, but may not yet work. Sprite support has been removed for the time being while it is re-worked.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403539
2009-02-18 00:33:31 +00:00
Sam Lantinga
aad9f51bdf Fixed bug #684
Reworked Pierre's patch a little bit, which added SDL_WaitEventTimeout()

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403538
2009-02-17 05:59:40 +00:00
Sam Lantinga
a0978cdf4d indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403537
2009-02-17 05:57:54 +00:00
Sam Lantinga
90b4c6937f Fixed bug #681
Description From  Philipp   2009-01-16 20:50:01   (-) [reply]

The File test/README from the svn says this:

    testgl        A very simple example of using OpenGL with SDL
    testgl2        Improved version of testgl

It is actually exchanged.

testgl.c is the improved version right now and testgl2.c the simple one.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403536
2009-02-17 05:44:49 +00:00
Sam Lantinga
605f1db186 Date: Thu, 27 Dec 2007 07:38:25 +0000
From: John Bartholomew
Subject: [SDL] SDL Semaphore implementation broken on Windows?
Hi,

Over the past couple of days, I've been battling with SDL, SDL_Mixer and SMPEG to try to find an audio hang bug.  I believe I've found the problem, which I think is a race condition inside SDL's semaphore implementation (at least the Windows implementation).  The semaphore code uses Windows' built in semaphore functions, but it also maintains a separate count value.  This count value is updated with bare increment and decrement operations in SemPost and SemWaitTimeout - no locking primitives to protect them.

In tracking down the apparent audio bug, I found that at some point a semaphore's count value was being decremented to -1, which is clearly not a valid value for it to take.

I'm still not certain exactly what sequence of operations is occuring for this to happen, but I believe that overall it's a race condition between a thread calling SemPost (which increments the count) and the thread on the other end calling SemWait (which decrements it).

I will try to make a test case to verify this, but I'm not sure if I'll be able to   (threading errors being difficult to reproduce even in the best    circumstances).

However, assuming this is the cause of my problems, there is a very
simple fix:
Windows provides InterlockedIncrement() and InterlockedDecrement()
functions to perform increments and decrements which are guaranteed to be atomic.  So the fix is in thread/win32/SDL_syssem.c: replace occurrences of --sem->count with InterlockedDecrement(&sem->count); and replace occurrences of ++sem->count with InterlockedIncrement(&sem->count);

This is using SDL v1.2.12, built with VC++ 2008 Express, running on a
Core 2 duo processor.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403535
2009-02-17 05:39:18 +00:00
Sam Lantinga
d9d69026ef Fixed bug #633
Description From  Michael Stone   2008-09-25 19:27:29   (-) [reply]

To determine whether a pid is occupied with the kill(pid, 0) idiom, you have to
test

#include <signal.h>
#include <errno.h>
kill(pid, 0) < 0 && errno == ESRCH

not just

#include <signal.h>
kill(pid, 0) < 0

otherwise you get incorrect results when pid is running as a different user
(causing kill(pid, 0) to return -1 + EPERM).

src/audio/alsa/SDL_alsa_audio.c is certainly affected by this bug in both
1.2.13 and 1.3-trunk. It probably occurs in other places as well.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403533
2009-02-17 05:17:51 +00:00
Sam Lantinga
d2e9f851e1 Fixed bug #537
Description From  esigra   2008-01-07 16:20:21   (-) [reply]

I try to get a clean compile for a project using SDL. But I get warnings
from SDL headers when I use -Wold-style-cast. This is especially bad
because I plan to build the software with -Werror=old-style-cast when we
have switched over to GCC 4.2, which has that option.

But this problem can be fixed in the SDL headers. I checked out the SVN
version and made some patches. See the attached patch.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403532
2009-02-17 04:57:39 +00:00
Sam Lantinga
b9924167f7 Fixed destination of XCopyArea()
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403530
2009-02-15 06:12:52 +00:00
Sam Lantinga
77c730b744 Added reminder for shaped windows
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403529
2009-02-14 15:56:26 +00:00
Sam Lantinga
8f29eb8e3f Suggestion from the mailing list
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403528
2009-02-14 15:53:52 +00:00
Sam Lantinga
31ee34541c Fixed off by one error in line drawing code
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403527
2009-02-12 06:01:54 +00:00
Sam Lantinga
377464c39e We need to figure out whether we should handle events on foreign windows
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403526
2009-02-09 06:45:03 +00:00
Sam Lantinga
0462c601c9 More of the same
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403525
2009-02-09 06:42:38 +00:00
Sam Lantinga
1e44bc512b Implemented Win32 version of the native window test
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403524
2009-02-09 06:41:49 +00:00
Sam Lantinga
408d9f3ed8 Whoops, missed a file
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403523
2009-02-09 06:28:45 +00:00
Sam Lantinga
be79fbf0ec Throw a FIXME in there, we'll need to take care of this later.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403522
2009-02-09 06:15:06 +00:00
Sam Lantinga
2aab251e38 Added test program for SDL_CreateWindowFrom()
Make sure OpenGL library is loaded before working with OpenGL windows,
even those created with SDL_CreateWindowFrom()

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403521
2009-02-09 05:32:12 +00:00
Sam Lantinga
0f598a332f Oh, Polyline() uses a pen, not a brush. Doh! :)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403520
2009-02-08 15:35:06 +00:00
Sam Lantinga
a9ca68d613 indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403519
2009-02-07 18:03:46 +00:00
Sam Lantinga
62dd3e61df Fixed alpha blending textures with the GDI renderer
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403518
2009-02-07 17:56:08 +00:00
Sam Lantinga
d67835c3de When creating a software texture, synchronize the surface with the texture.
When creating a texture from a surface, synchronize the texture with the surface.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403517
2009-01-30 06:40:16 +00:00
Sam Lantinga
d0b1ee8e2f indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403516
2009-01-30 06:38:44 +00:00
Sam Lantinga
9bb60da027 --HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403514
2009-01-29 13:25:08 +00:00
Sam Lantinga
feb6aa80f8 Fixed Altivec blitters for PPC
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403513
2009-01-25 05:14:29 +00:00
Sam Lantinga
9e7160c456 More Mac OS X 10.3.9 fixes
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403512
2009-01-19 15:58:57 +00:00
Sam Lantinga
182eefe860 Fixed compilation on Mac OS X 10.3.9
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403511
2009-01-19 15:15:03 +00:00
Sam Lantinga
897fcf93b0 Updated for older versions of subversion
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403510
2009-01-19 07:35:52 +00:00
Sam Lantinga
62ab848372 Fix recommended by Eddy L O Jansson
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403509
2009-01-19 03:28:23 +00:00
Edgar Simo
cf3db86918 Some more safety around the SDL_HelperWindow stuff to avoid double creations.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403508
2009-01-18 17:00:02 +00:00
Bob Pendleton
ffe056fff1 Changes to hopefully handle the creation of a colormap for 8 bit PseudoColor visuals in X11
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403506
2009-01-15 21:35:42 +00:00
Sam Lantinga
19e137cf11 Unfortunately, adding the file means that every commit marks this file as
modified, even with the svn:ignore property set.  *sigh*

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403505
2009-01-14 15:03:44 +00:00
Sam Lantinga
0d1b4261b2 Added a dummy revision to fix IDE builds
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403504
2009-01-14 15:00:22 +00:00
Sam Lantinga
a2c7f4e1b4 Fixed OpenGL state issue reported by Dmytro Bogovych
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403503
2009-01-14 06:53:03 +00:00
Sam Lantinga
628262d3af indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403502
2009-01-14 04:25:32 +00:00
Couriersud
072760ebb7 Fix fullscreen crash with DirectFB <= 1.2.0
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403501
2009-01-13 23:27:08 +00:00
Couriersud
c11962b08c Fixed MakeSubSurface compiling issue for DirectFB <= 1.2.0
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403500
2009-01-13 22:59:02 +00:00
Couriersud
eeeee88591 Added DFB_VERSION_ATLEAST macro
First attempt at replacing MakeSubSurface for pre 1.2.0 ==> Scaling not yet working

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403499
2009-01-13 21:17:38 +00:00
Bob Pendleton
4907b7e608 Added
#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS NULL
#endif

so that the X code would compile. It looked like it was needed

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403498
2009-01-13 19:31:06 +00:00
Sam Lantinga
bb8513855f Removed Rafal Bursig's MMX RLE code, at his request.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403497
2009-01-13 07:20:55 +00:00
Sam Lantinga
97baa9c439 Fixed NULL pointer dereference
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403496
2009-01-13 03:53:22 +00:00
Couriersud
aa47998f53 Fix third party "-Wall -Werror" builds
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403495
2009-01-12 22:36:12 +00:00
Sam Lantinga
e43f6d619e Fixed Visual C++ build
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403494
2009-01-12 08:46:28 +00:00
Sam Lantinga
9116448bf3 Don't complain when the GNOME screensaver isn't running (or available)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403493
2009-01-12 08:28:17 +00:00
Sam Lantinga
538276cc18 This is so wrong, it hurts.
Instead of the GNOME screensaver respecting the MIT-SCREEN-SAVER extension
and registering for the screensaver idle event, it uses a completely different
control mechanism.  Our alternatives are to use dbus (very complicated) or
this really painful hack.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403492
2009-01-12 08:26:24 +00:00
Sam Lantinga
a097a4105f Re-enable the screensaver at exit, just in case it's needed...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403491
2009-01-12 08:23:47 +00:00
Sam Lantinga
92091bf9b8 Don't disable the screen saver by default for windows applications
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403490
2009-01-12 08:23:12 +00:00
Sam Lantinga
3c5fca041a Fixed snapshot target
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403489
2009-01-12 06:22:26 +00:00
Sam Lantinga
439443508b Reverted SDL_LoadICO_RW() addition, this should go in SDL_image
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403488
2009-01-12 06:21:34 +00:00
Sam Lantinga
4ca3bd3da1 Added an API to enable/disable the screen saver.
The screensaver is disabled by default when using SDL 1.2 compatibility.
Use the new XScreenSaver extension, removed unused DPMS extension.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403487
2009-01-12 06:19:05 +00:00
Couriersud
4bb83c1f39 Add SDL_LoadICO_RW to SDL. Loads best quality icon from *.ico file.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403486
2009-01-11 23:56:19 +00:00