Commit graph

2797 commits

Author SHA1 Message Date
Sam Lantinga
0543b444ac Date: Thu, 05 Feb 2009 17:27:54 +0100
From: Stefan Klug
Subject: [SDL] SDL_SetVideoMode compatibility fix

SDL_SetVideoMode(0,0,0,flags) used to be valid in SDL 1.2
Attached is a patch to replicate this behaviour in SDL 1.3

Cheers Stefan

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403565
2009-03-23 05:37:45 +00:00
Sam Lantinga
d2d2e1c376 Date: Thu, 05 Feb 2009 18:07:35 +0100
From: Stefan Klug
Subject: [SDL] SDL 1.3 WinCE backend

as promised, I've started to work on the WinCE backend of SDL 1.3
I've modified the win32 video backend and the gdi renderer, to work
properly in WinCE.
The results till now are great, but there is still some work to do.

Attached are two patches with my changes.
I would be happy if someone could review and propably commit them.

The first one (configure.in.patch) should be straight forward without
any side effects.

The second one does the necessary changes to the win32 backend. I was
really unhappy to start slicing this shiny new backend with
#ifdef/#endif but I saw no other option.

The most problematic issues are:
- WinCe has no GetDIBits, so its practically impossible to fill a
BITMAPINFO with correct values. I therefore removed the bmi member from
the GDI_RenderData in SDL_gdirender.c to prevent usage of a not or not
properly initialized  bmi.
- In SDL_win32window.c I exchanged some ASCII function by their general
counterparts, (In CE only the Unicode versions are available). I don't
know if this has a negative effect when running in win32


Cheers
Stefan

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403564
2009-03-23 05:35:21 +00:00
Sam Lantinga
e403bb296f Date: Tue, 17 Feb 2009 14:00:25 +0100
From: Stefan Klug
Subject: [SDL] Possible bug, paused audio playing garbage

On my WinCE device a paused audio device plays random garbage.
This might also be the issue in the thread "sound cracks with SDL_mixer
and AUDIO_S16LSB"

I don't have that much knowledge of the SDL audio part, but the attached
patch fixes it for me, and collapses two redundant ifs.

I'm not sure if this is the correct way to fix this.
Shouldn't the complete stream conversion part of the RunAudio loop be
dependent on the paused property of the device? (not only the call to
(*fill)(udata, istream, istream_len).

Anyways. Would be great if the patch or a fix could find its way to SVN ;-)

Cheers
Stefan

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403563
2009-03-23 05:21:40 +00:00
Sam Lantinga
2bacdee082 Date: Sat, 21 Mar 2009 19:41:52 -0700 (PDT)
From: Mason Wheeler
Subject: [SDL] Critical SDL 1.3 patch

Displaying a window created with SDL_CreateWindowFrom was causing stack overf
lows for me under certain conditions.  After far too much work trying to get
Visual Studio's debugger to play nice with a program written in Delphi, I tra
cked it down to a nasty reentrancy cycle in the WndProc handling.  Here's a p
atch that fixes the problem

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403562
2009-03-23 02:02:30 +00:00
Sam Lantinga
a01cdb4253 Fixed potential crash in testbitmap
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403561
2009-03-22 06:56:37 +00:00
Sam Lantinga
7a8aae678e Fixed iPhone demos
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403559
2009-03-17 03:56:21 +00:00
Sam Lantinga
4d78fdcef7 Date: Thu, 12 Mar 2009 15:14:38 +0200
From: "Mike Gorchak"
Subject: New QNX patches

In photon.tar.gz there are new files to be placed into ./src/video/photon/
directory.

qnx3.diff - new patches for QNX support. Since I've found a lot of bugs in
the new GF QNX Graphics Framework and I'm suspended development for GF
driver until already found bugs will be fixed and switched to Photon driver
implementation.

sdl.diff - I've found that renderer creation result has not been checked and
SDL shows error like: "there is no current renderer", now SDL will show
correct error which was set be renderer.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403558
2009-03-17 03:24:22 +00:00
Sam Lantinga
65fa34140f Fixed return value for SDL_CreateRenderer()
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403557
2009-03-15 15:50:18 +00:00
Sam Lantinga
98c33d2db1 Fixed OpenGL library linking issue
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403556
2009-03-12 03:51:39 +00:00
Sam Lantinga
17406a3e50 Fixed potential double-free crash
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403555
2009-03-06 05:53:33 +00:00
Sam Lantinga
2bed25d87c Reverted dangerous change that could remove /bin/sh :)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403554
2009-03-06 05:48:52 +00:00
Sam Lantinga
ba4c542eeb Date: Wed, 4 Mar 2009 15:38:22 +0200
From: "Mike Gorchak"
Subject: Re: About QNX support in SDL 1.3

Here is another batch of patches.

1) Makefile.in - added SDL_opengles.h header as header to install.
2) configure.in - Added special define to detect Common Lite OpenGL ES
library in case if Common library is not installed. Added check for
clock_gettime in libc (in QNX it is in libc).
3) SDL_config.h.in - Added SDL_VIDEO_RENDER_OPENGL_ES and
SDL_VIDEO_OPENGL_ES declarations for configure script autodetection.
4) SDL_opengles.h - Added GL_API definition if it is not defined. Added
extension GL_OES_draw_texture because OpenGL ES Renderer uses it without
declaration. Added GL_OES_vertex_buffer_object extension, which is supported
under QNX OpenGL ES. Added GL_OES_single_precision extension.
5) To the test directory I've added building OpenGL ES test applications
through the autotools suite. Was support for iPhone IDE building only.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403553
2009-03-04 15:10:47 +00:00
Sam Lantinga
7c0777a910 Updated config.guess and config.sub
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403552
2009-03-04 09:35:32 +00:00
Sam Lantinga
dc650bdd28 Updated libtool from version 1.5.22 to 2.2.6a, so it works on current QNX
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403551
2009-03-04 08:57:30 +00:00
Sam Lantinga
160fe5bc11 Mac OS X and iPhoneOS have the full math library
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403550
2009-03-03 09:48:00 +00:00
Sam Lantinga
e87963bb44 Date: Mon, 2 Mar 2009 16:27:42 +0200
From: "Mike Gorchak"
Subject: About QNX support in SDL 1.3

Right now I'm working on QNX SDL 1.3 drivers implementation and looks like a
lot of code must be completely reworked. But I'm ready for it :) Also I want
to add QNX Graphics Framework SDL driver, which is fullscreen graphics
framework, with support of hardware accelerated OpenGL ES implementations.
This Graphics Framework (called GF in QNX) could also use QNX Photon (window
manager GUI) as window manager.

In the attachment initial patch for QNX support in SDL 1.3

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403549
2009-03-03 04:21:51 +00:00
Sam Lantinga
89b23cc7ea Removed unicows dependency, at least for now...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403548
2009-02-27 09:51:55 +00:00
Sam Lantinga
9e37ac40e6 Missing API function
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403547
2009-02-27 09:39:39 +00:00
Edgar Simo
5f6b802b96 More verbosity and error checking.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403546
2009-02-21 18:03:22 +00:00
Edgar Simo
dd682a6489 Fixed haptic subsystem on linux 2.6.28 by lowering the EV_IsJoystick check (seems like some stuff was changed). Shouldn't break anything with earlier versions. Might need to be more robust if false positives show up.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403545
2009-02-21 18:02:55 +00:00
Sam Lantinga
755e92afcb indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403544
2009-02-19 06:49:59 +00:00
Sam Lantinga
fbfd97d958 Implemented X11 maximized state control
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403543
2009-02-19 06:48:25 +00:00
Sam Lantinga
68e2c17401 Use the default arrow cursor until we implement the cursor API
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403542
2009-02-19 04:41:09 +00:00
Sam Lantinga
db32da3f78 Fixed bug using SDL_WINDOWPOS_CENTERED with SDL_SetWindowPosition()
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403541
2009-02-19 04:15:04 +00:00
Sam Lantinga
609e3b3c91 Added missing files
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403540
2009-02-19 04:03:05 +00:00
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