Commit graph

2003 commits

Author SHA1 Message Date
Sam Lantinga
143563c826 Updated for the new pixel format structure
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404167
2009-11-11 06:34:33 +00:00
Sam Lantinga
0e8fa16511 Work in progress on implementation of SDL_RenderReadPixels() and SDL_RenderWritePixels(), code untested.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404163
2009-11-09 05:20:11 +00:00
Sam Lantinga
27a44195ae Fixed compile warning
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404161
2009-11-08 04:21:59 +00:00
Sam Lantinga
6c0d20ab8c Skip renderers that fail to initialize
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404160
2009-11-08 04:16:42 +00:00
Sam Lantinga
8f71172aad Fixed bug #847
Roger Willcocks      2009-10-25 08:45:37 PDT

appDidFinishLaunching is triggered before all the setup's complete. The easiest
fix is to arrange for another event to be sent when it's really ready, and run
SDL_main from there. Ref.
http://blog.rightsprite.com/2008/11/iphone-applicationdidfinishlaunching.html

SDL-1.3.0-4563/src/video/uikit/SDL_uikitappdelegate.m:



- (void)postFinishLaunch {

    /* run the user's application, passing argc and argv */
    int exit_status = SDL_main(forward_argc, forward_argv);

    /* free the memory we used to hold copies of argc and argv */
    int i;
    for (i=0; i<forward_argc; i++) {
        free(forward_argv[i]);
    }
    free(forward_argv);

    /* exit, passing the return status from the user's application */
    exit(exit_status);

}

- (void)applicationDidFinishLaunching:(UIApplication *)application {

    /* Set working directory to resource path */
    [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle
mainBundle] resourcePath]];

    [self performSelector:@selector(postFinishLaunch) withObject:nil
afterDelay:0.0];

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404148
2009-11-02 07:55:42 +00:00
Sam Lantinga
115c22f261 cpuid doesn't actually change the flags register
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404146
2009-10-30 05:02:47 +00:00
Sam Lantinga
a0fd7e1cba Fixed bug #734
Save and restore the PIC register %ebx/%rbx using push/pop instead of %edi/%rdi

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404145
2009-10-30 04:45:01 +00:00
Mike Gorchak
ef88f68a9d Cursor hotspot fixes.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404144
2009-10-29 09:20:50 +00:00
Sam Lantinga
6d92d75009 Automatically initialize the video system and create a renderer to simplify use.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404141
2009-10-28 06:04:07 +00:00
Sam Lantinga
cf7ca27b19 Adam Strzelecki to SDL
I think something is wrong (look at the fix patch below):
(1) NSRect rect shouldn't be initialized with contentRectForFrameRect: at the top of the function, contentRectForFrameRect is called in non-fullscreen case anyway (1st @@)
(2) I think you've left two lines that should be removed completely (2nd @@)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404138
2009-10-23 04:08:32 +00:00
Sam Lantinga
f9c1667f92 Adam Strzelecki to SDL
When using deployment in Xcode we use 10.4 SDK for PPC & i386 and 10.6 SDK for x86_64 unfortunately MAC_OS_X_VERSION_10_6 is defined only in 10.6 SDK, in older SDKs it is undefined which makes >= comparison return always TRUTH, so the GCC complains about undefined <NSWindowDelegate>, even if the original intention was to omit <NSWindowDelegate> on older SDKs.

Solution, don't relay on MAC_OS_X_VERSION_10_6 but use OSX revision number 1060 directly as SDL does in many other places.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404137
2009-10-23 03:58:23 +00:00
Mike Gorchak
40aaaac9e1 Fixes in GLES configuration selection.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404136
2009-10-22 06:09:03 +00:00
Mike Gorchak
ae491a8246 Fixes in GLES configuration selection. Support for an old QNX 6.3.2.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404135
2009-10-22 06:08:36 +00:00
Sam Lantinga
c558493b24 Adam Strzelecki to SDL
Sending a patch for fullscreen Mac OS X SDL 1.3 (SVN) Cocoa mouse position handling. In fullscreen mouse coordinates should be relative to SCREEN not to the window, which doesn't really occupy fullscreen.
Without this patch mouse position (especially Y) was totally incorrect (shifted) in fullscreen.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404132
2009-10-22 04:46:11 +00:00
Sam Lantinga
4483fc99e3 There's a bug with gcc 4.4.1 and -O2 where srcp doesn't get the correct value after the first scanline. Ugh.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404115
2009-10-18 23:21:15 +00:00
Sam Lantinga
7df7cdde39 Merged improvements to SDL_SoftStretch() from SDL 1.2
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404113
2009-10-18 17:49:40 +00:00
Sam Lantinga
410baa467e Fixed bug #853
Ludwig Nussel      2009-10-18 05:34:18 PDT

src/joystick/linux/SDL_sysjoystick.c has some problems:

- test_bit() might break with strict aliasing
- test_bit() assumes array is Uint32 but its actually "unsigned long"
  on 64bit systems sizeof(long) != sizeof(Uint32).
- the keybit array is too small
- the arrays are unitialized so the number of
  detected buttons is quite random

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404108
2009-10-18 16:14:35 +00:00
Sam Lantinga
f2ae715bf4 iPhone interruption patch / SDL 1.3
Eric Wing to Sam

I've been sitting on this too long. I need to push.
It's untested because of the unrelated crashing bug I've been experiencing.
Also have a fix for SIZEOF_VOIDP in the config for both iPhone and Mac.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404102
2009-10-17 07:36:45 +00:00
Mike Gorchak
f22214ce9b Working on fullscreen video modes support
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404087
2009-10-13 20:17:11 +00:00
Mike Gorchak
0ce7835ad6 All 2D operations in Photon driver have been finished. The driver is ready to use. There fullscreen modes and YUV textures are rest only.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404083
2009-10-13 11:26:40 +00:00
Mike Gorchak
de6930e985 Fixed SDL_BLENDMODE_MASK for GL and GLES renderers, now blending works like in software renderer.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404074
2009-10-13 06:51:20 +00:00
Mike Gorchak
ebd6bbf4d0 Fixed OpenGL ES primitive alpha blending.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404069
2009-10-13 06:28:31 +00:00
Mike Gorchak
f617baee05 Initial support for fullscreen application modes.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404063
2009-10-12 19:47:01 +00:00
Mike Gorchak
d023c50f43 Photon SDL renderer almost finished, the double/tripple buffering is left only.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404062
2009-10-12 11:45:01 +00:00
Sam Lantinga
344d83f986 Joystick patch from FreeBSD ports system
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404061
2009-10-12 09:42:50 +00:00
Mike Gorchak
d54f916cc3 Continue working on 2D support in Photon.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404058
2009-10-12 08:21:43 +00:00
Mike Gorchak
e2e843a389 Continue working on 2D support in Photon
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404055
2009-10-11 18:45:39 +00:00
Mike Gorchak
5303617926 Continue working on 2D support for Photon/QNX.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404047
2009-10-10 20:15:20 +00:00
Sam Lantinga
5575687744 Debian patch: 218_joystick_memmove.diff
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404032
2009-10-10 10:02:17 +00:00
Sam Lantinga
a1d457ae81 Whoops, FreeBSD 6.2 doesn't define __FreeBSD_kernel_version
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404027
2009-10-10 09:44:04 +00:00
Sam Lantinga
abf5cb8c2f Adapted from Debian patch: 215_kfreebsd_gnu.diff
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404023
2009-10-10 09:36:12 +00:00
Mike Gorchak
9a25579e5f Support for the atomic operations for ARM, PPC, MIPS, SH, X86 platforms has been added.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404010
2009-10-10 08:06:18 +00:00
Sam Lantinga
7e6cba931b Fixed bug #627
Increased accuracy of alpha blend calculation

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404009
2009-10-10 07:48:57 +00:00
Ryan C. Gordon
885758b318 Merged r4990:4991 from branches/SDL-1.2: ALSA 1.0 API and dlvsym() removal.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404007
2009-10-10 07:34:15 +00:00
Sam Lantinga
2e3beaf83d typo
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404004
2009-10-10 06:51:42 +00:00
Sam Lantinga
4968cb27ac Fixed bug #814
Daniele Forghieri      2009-09-30 15:40:53 PDT

To compile the source in libm the variable huge must be renamed, I choose
huge_val

The patch attached change it so it compiles

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403961
2009-10-04 09:51:04 +00:00
Sam Lantinga
4051f91f05 Fixed a bug where when the audio starts paused all the DirectSound buffers
will end up getting locked and never unlocked and sound will never play.

Added a FIXME for Ryan to look at, too. :)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403960
2009-10-04 09:18:48 +00:00
Sam Lantinga
de0dbff224 Adam Strzelecki to SDL
Since current DirectFB implementation is incomplete for YUV surfaces (actually causes segmentation faults when trying Lock and use YUV planar textures) I decided to fix it a bit.
Here's a patch that should make DirectFB properly support YUV both packed and planar (3 planes).

(1) Removed SDL_BYTESPERPIXEL at all in favor of DFB_BYTES_PER_PIXEL(SDLToDFBPixelFormat(fmt)) which does return always proper BPP for YUVs too, coz SDL_BYTESPERPIXEL returns incorrect values for FOURCCs
(2) Fixed data->pixels allocation for planar YUVs in CreateTexture, it should allocate 150% more space
(3) Copy other planes for planar YUVs in UpdateTexture
(4) Moved checking if format is supported at all with DirectFB on CreateTexture at the beginning of the code

Waiting for comments,
--
Adam Strzelecki | nanoant.com

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403959
2009-10-04 04:03:37 +00:00
Sam Lantinga
7f26231261 [SDL] Bad math in SDL_RenderCopy
Mason Wheeler to sdl

When I tried to render an image using something other than NULL for srcrect, it got horribly distorted.  I traced it down to the fact that the math in the rectangle adjustments performed just before the call to renderer->RenderCopy is written inside out.  It should look like this:

       if (dstrect->w != real_dstrect.w) {
           int deltax = (dstrect->x - real_dstrect.x);
           int deltaw = (dstrect->w - real_dstrect.w);
           real_srcrect.x += (deltax * real_srcrect.w) / dstrect->w;
           real_srcrect.w += (deltaw * real_srcrect.w) / dstrect->w;
       }
       if (dstrect->h != real_dstrect.h) {
           int deltay = (dstrect->y - real_dstrect.y);
           int deltah = (dstrect->h - real_dstrect.h);
           real_srcrect.y += (deltay * real_srcrect.h) / dstrect->h;
           real_srcrect.h += (deltah * real_srcrect.h) / dstrect->h;

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403957
2009-10-03 16:23:16 +00:00
Sam Lantinga
efc7893227 Temporary band-aid for bug #575
It looks like newer kernels do the logical device mapping in the driver,
so this code crashes.  I don't have one of these nor do I have remote
access to debug this, so I'm disabling the logical mapping for now.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403937
2009-09-29 00:42:21 +00:00
Sam Lantinga
eb162e1725 -0.5 is causing trouble according to comments in bug #783
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403932
2009-09-28 15:32:58 +00:00
Sam Lantinga
8349cf0831 Fixed bug #716
Armin Burgmeier      2009-03-15 04:35:45 PDT

When I hold a mouse button down on another (non-SDL) window, then move the
mouse over an SDL window and releasing the mouse button there, then the
application does not receive an SDL_ACTIVEEVENT with state SDL_APPMOUSEFOCUS
and gain 1.

Furthermore, SDL_GetAppState() reports the application not having mouse focus
until moving the mouse out of the window and back in again.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403927
2009-09-27 23:24:58 +00:00
Sam Lantinga
bb9b983417 Fixed 32-bit build
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403916
2009-09-26 21:39:56 +00:00
Sam Lantinga
bda0828ef8 Fixed bug #797
Ryan C. Gordon      2009-09-19 08:25:21 PDT

This line in SDL_iconv_string (src/stdlib/SDL_iconv.c) ...

        if (!fromcode || !*fromcode) {
            tocode = "UTF-8";
        }

Is probably supposed to assign to "fromcode" and not "tocode".

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403912
2009-09-26 10:36:55 +00:00
Sam Lantinga
a305eb8541 Fixed bug #777
Implemented SDL_GetPlatform()

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403911
2009-09-26 10:32:14 +00:00
Sam Lantinga
1035ec66ff Fixed bug #766
Mason Wheeler      2009-07-06 14:29:47 PDT

This adds some missing error reporting for SDL_SelectRenderer, and cleans up the logic a little bit.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403910
2009-09-26 10:22:35 +00:00
Sam Lantinga
0990e2250c Fixed bug #765
Added SDL_SetError case for SDL_UNSUPPORTED

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403909
2009-09-26 10:19:19 +00:00
Sam Lantinga
ac573d8522 Fixed bug #764
Added better error checking from Mason Wheeler

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403908
2009-09-26 10:17:49 +00:00
Sam Lantinga
ba8fff9ab2 Fixed bug #761
Mason Wheeler      2009-07-05 09:28:33 PDT

This patch fixes two issues with SDL_CreateTextureFromSurface.

1.  If no renderer is available, the function will return 0 without calling
SDL_SetError. (It does this in other places as well, but it appears that in
these cases, SDL_SetError was already called by a previous function call.)
2.  Removal of a dead code block that checks for an impossible return value.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403907
2009-09-26 10:13:44 +00:00
Sam Lantinga
b42df3ec21 Fixed bug #734
Nicholas Phillips      2009-04-26 21:34:05 PDT

I am using x64 Linux (using Intel Core 2 DUO), and I have noticed that there is
an error in SDL_cpuinfo.c, function CPU_getCPUIDFeaturesExt for my platform.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403905
2009-09-26 10:04:38 +00:00