Commit Graph

11015 Commits

Author SHA1 Message Date
Sam Lantinga
327a62cd62 Increment version... 2004-04-23 14:00:08 +00:00
Sam Lantinga
4423b9c455 Date: Sat, 10 Apr 2004 02:25:33 -0400
From: Glenn Maynard
To: sdl@libsdl.org
Subject: [SDL] SDL_SetVideoMode() failing and not setting an error (patch)

Running an OpenGL SDL application off 1.2.7, at SDL_InitSubSystem(SDL_INIT_VIDEO) time:

Warning: Unable to initialize AAlib mouseUsing AAlib driver: Slang driver 1.0 (slang)

SDL_SetVideoMode then fails; SDL_GetError() returns "".

The installation problem is straightforward: X (the higher priority
driver) isn't running, so SDL is falling back on aalib.  However,
no error is being set when aalib fails to initialize.  This also
happens with the svgalib driver.

SDL_video.c line ~653 sets mode to NULL, since aalib didn't return an
OpenGL surface.  Line ~711 ("failed setting a video mode") returns NULL.
The attached patch sets an error.  It's a horrible, useless error
message--it should really say eg. "aalib does not support OpenGL"; this
should probably be done earlier in the individual drivers, too.
2004-04-11 19:54:40 +00:00
Sam Lantinga
92d9b84afc Date: Sun, 11 Apr 2004 13:09:44 +0200
From: Stephane Marchesin
Subject: [SDL] [Patch] inlining memcpy functions

I (finally) did some benchmarking of the misc mmx & sse blitting
functions, and found a little bottleneck in the memcpy ones : you get
~10% more performance on small surface blitting if you inline them.
2004-04-11 19:52:58 +00:00
Sam Lantinga
6f9b06c0bb Date: Tue, 30 Mar 2004 18:18:13 -0600
From: Tyler Montbriand
Subject: [SDL] Detecting Opteron CPU features

I can now get SDL_cpuinfo.c to detect the AMD Opteron's RDTSC, MMX, MMXEXT,
3DNOW, 3DNOWEXT, SSE, and SSE2 instruction set extensions under Linux.  It
took one #ifdef'ed block of new asm code to account for the 64-bit flags
register, but the other two blocks worked fine without modification, just
needed to modify the #ifdef's a bit.
2004-04-11 19:49:34 +00:00
Sam Lantinga
9ce7dd9220 Date: Tue, 30 Mar 2004 21:26:47 -0600
From: Tyler Montbriand
Subject: [SDL] Opteron MMX patches for SDL_blit.c and SDL_blit_A.c

The inline MMX assembly in SDL_blit.c and SDL_blit_A.c compiles and runs fine
unmodified under AMD Opteron.  The inline assembly in SDL_yuv_mmx.c and
SDL_blit_N.c unfortunately isn't directly compatible.

I've included diffs from SDL_blit.c and SDL_blit_A.c that allow the MMX
assembly to be compiled when USE_ASMBLIT, __x86_64__, and __GNUC__ are all
defined.  All I had to modify was typedefs, the inline assembly itself wasn't
touched.
2004-04-11 19:47:28 +00:00
Sam Lantinga
37e0fb4d7b Date: Wed, 31 Mar 2004 09:15:57 -0600
From: Tyler Montbriand
Subject: [SDL] Opteron MMX patches for SDL_RLEaccel.c

The inline MMX assembly in SDL_RLEaccel.c compiles unmodified if the typedefs
are adjusted to accept __x86_64__.  The diff from SDL-1.2.7 is attached.
2004-04-08 21:13:14 +00:00
Sam Lantinga
db6b48df28 Argh... 2004-04-08 21:06:10 +00:00
Sam Lantinga
871cb27b15 Yack... finally fixed the MacOS X development package ... I hope! 2004-03-27 16:15:42 +00:00
Ryan C. Gordon
1373de79c0 (Said Max Horn on the SDL mailing list...)
Hi folks,

based on Eric Wing's patch, I created the attached patch which fixes
the OpenGL coordinate inversion bug in SDL. It works fine over here on
10.3 with Ryan's test program (which I also attached).

There is another change in it: I removed the "- 1" in the two lines
using CGDisplayPixelsHigh()... while I understand from a logical point
of view why they *should* be correct, I checked the actual values
computed that way, and they were off-by-one. After removing the " - 1",
the returned mouse coordinates are correct. I checked this by moving
the mouse to the screen top/bottom in fullscreen mode, BTW. With the
change, the proper values 0 and 479 are returned (in 640x480 mode).

Sam, you may still want to test on 10.1, it's very simple using Ryan's
minimal test code :-)

Cheers,

Max




(Here is the reproduction case for revision history's sake...)


/*
 * To compile:
 *   gcc -o test test.c `sdl-config --cflags` `sdl-config --libs` -framework OpenGL
 *
 *  --ryan.
 */

#include <stdio.h>
#include "SDL.h"
#include "SDL_opengl.h"

int main(int argc, char **argv)
{
    Uint32 flags = SDL_OPENGL /* | SDL_FULLSCREEN */;
    SDL_Surface *screen;
    SDL_Event event;
    int done = 0;
    GLfloat ratio;

    SDL_Init(SDL_INIT_VIDEO);
    SDL_ShowCursor(0);
    if ((argv[1]) && (strcmp(argv[1], "--grab") == 0))
        SDL_WM_GrabInput(SDL_GRAB_ON);
    screen = SDL_SetVideoMode(640, 480, 0, flags);
    if (!screen)
        return(42);

    ratio = ((GLfloat) screen->w) / ((GLfloat) screen->h);
    glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
    glClearDepth( 1.0f );
    glEnable( GL_DEPTH_TEST );
    glDepthFunc( GL_LEQUAL );
    glViewport( 0, 0, screen->w, screen->h);
    glMatrixMode( GL_PROJECTION );
    glLoadIdentity();
    gluPerspective( 45.0f, ratio, 0.1f, 100.0f );
    glMatrixMode( GL_MODELVIEW );
    glLoadIdentity();
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    SDL_GL_SwapBuffers();


    // eh, close enough.
    #define MAX_X 6.12
    #define MAX_Y 4.50

    while (!done)
    {
        int x, y;
        GLfloat glx, gly;

        if (!SDL_WaitEvent(&event))
            break;

        switch (event.type)
        {
            case SDL_KEYUP:
                if (event.key.keysym.sym == SDLK_ESCAPE)
                    done = 1;
                break;
        }

        SDL_GetMouseState(&x, &y);
        glx = ((((GLfloat) x) / ((GLfloat) screen->w)) - 0.5f) * MAX_X;
        gly = ((((GLfloat) y) / ((GLfloat) screen->h)) - 0.5f) * MAX_Y;

        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    	glLoadIdentity();
        glTranslatef(glx,-gly,-6.0f);

        glBegin(GL_TRIANGLES);
            glColor3f(1,0,0); glVertex3f( 0.00f,  0.25f, 0.00f);
            glColor3f(0,1,0); glVertex3f(-0.25f, -0.25f, 0.00f);
            glColor3f(0,0,1); glVertex3f( 0.25f, -0.25f, 0.00f);
	    glEnd();

        SDL_GL_SwapBuffers();
    }

    SDL_Quit();
    return(0);
}

/* end of test.c ... */
2004-03-22 09:38:20 +00:00
Sam Lantinga
133457bbfb Fixed the postinstall script 2004-03-11 13:38:51 +00:00
Sam Lantinga
5894574057 Date: Thu, 11 Mar 2004 18:45:17 +0900
From: Hayashi Naoyuki
Subject: Re: Tru64 cdrom and pthread option fix

I wrote
/* Some CD-ROM drives cannot play the first 150 frames. */
in src/cdrom/osf/SDL_syscdrom.c
and
Some CD-ROM drives(ex. TEAC CD-532E) cannot play first 150 frames(aka gap).

but this is not right.

It is written in MMC that LBA = 4500*M + 75*S + F - 150.
2004-03-11 12:59:41 +00:00
Sam Lantinga
8493c3e7ad Date: Sun, 07 Mar 2004 22:54:11 +0900
From: Hayashi Naoyuki
Subject: Tru64 cdrom and pthread option fix

SDL-1.2.7/src/cdrom/osf/SDL_syscdrom.c Fixes
Some CD-ROM drives(ex. TEAC CD-532E) cannot play
first 150 frames(aka gap).
CheckDrive() fix.
The end of comment is "* /" in AddDrive().

SDL-1.2.7/configure.in Fixes
Add *-*-osf pthread option and
delete line SDL_LIBS="$SDL_LIBS -lrt".
2004-03-07 16:40:15 +00:00
Sam Lantinga
456a172311 Date: Fri, 05 Mar 2004 16:08:01 +0000
From: Alan Swanson
Subject: Re: [SDL] Fatal signal when initiaize with USB joystick on 2.6.2 kern

On Fri, 2004-03-05 at 15:09, Sam Lantinga wrote:
> > Fred, how does the attached patch work for you? Do all your axes work?
>
> I think you meant the two lines to be reversed.
> I checked a more robust version of this into CVS.  Fred, can you see if
> it works?

You've misread the code. :-/

For coef[0] and coef[1], it is (values[2]+values[1]) / 2 and then add
or subtract values[4] to the answer.
2004-03-06 02:58:06 +00:00
Sam Lantinga
ac9d12eaf8 Avoid FPE with Linux 2.6 2004-03-05 15:09:18 +00:00
Sam Lantinga
3d4dbef0c5 Date: Wed, 3 Mar 2004 12:44:21 +0200
From: "Mike Gorchak"
Subject: Misc fixes again

I've added custom WM info for the QNX (same as generic for now), which allows to compile all applications, which included SDL_syswm.h directly, otherwise DISABLE_X11 appearing to be not defined and X11 info was used instead, which is wrong.
2004-03-04 05:41:57 +00:00
Sam Lantinga
09c66b6708 Instructive comments from Max Horn 2004-03-04 05:39:17 +00:00
Sam Lantinga
ef1b944fae sed, it's two, two commands in one! 2004-03-03 06:56:04 +00:00
Ryan C. Gordon
a8a00f5498 Force recreation of X11 window if going to or from a SDL_NOFRAME vidmode. 2004-03-02 19:38:55 +00:00
Sam Lantinga
b3e72359f4 Date: Tue, 2 Mar 2004 11:34:54 +0100
From: Bartosz Fenski aka fEnIo
Subject: outdated entry in INSTALL file

I've just found in INSTALL file:

        If you are cross-compiling from Linux to Win32, you should read
        the file README.Win32

But you don't shipped this file with SDL. I've found in CVS logs that
this file has been deleted and this information is now in FAQ.
2004-03-02 13:01:02 +00:00
Sam Lantinga
a122ee994b Date: Sun, 29 Feb 2004 15:14:22 +0200
From: Martin_Storsj
Subject: Dynamic loading of ALSA

I recently discovered that SDL can dynamically load ESD and aRts, and
made a patch which adds this same functionality to ALSA.

The update for configure.in isn't too good (it should e.g. look for
libasound.so in other directories than /usr/lib), because I'm not too
good at shellscripting and autoconf.

The reason for using dlfcn.h and dlopen instead of SDL_LoadLibrary and
SDL_LoadFunction is that libasound uses versioned symbols, and it is
necessary to load the correct version using dlvsym. This isn't probably
any real portability issue, because ALSA is linux-only.
2004-03-02 12:49:16 +00:00
Sam Lantinga
0b61527eaa Date: Sun, 29 Feb 2004 20:28:27 +0200
From: Martin_Storsj
Subject: Slight bug in ESD and aRts

When I experimented with the ALSA-patch, I found a slight bug in the
Load{ESD,ARTS}Library-functions. The check of whether a function pointer
was correctly loaded looks like this right now:

*esd_functions[i].func = SDL_LoadFunction(esd_handle,
esd_functions[i].name);
if ( ! esd_functions[i].func )

Isn't that supposed to be ( ! *esd_functions[i].func )?
2004-03-02 12:45:22 +00:00
Sam Lantinga
f119900ade Date: Tue, 2 Mar 2004 08:52:20 +0200
From: "Mike Gorchak"
Subject: Just a misc. fixes

1) I've added a small fix to the .qpg file - SDLqpg.diff. Added autoconf variables like the @SDL_BINARY_AGE@ instead of directly using "...so.7".
2004-03-02 12:38:27 +00:00
Sam Lantinga
7b56bd9487 IRIX doesn't have a GL library versioning system 2004-02-26 20:49:45 +00:00
Sam Lantinga
ba724f0612 Oops, ignore SIGALRM, not 0 2004-02-26 19:57:37 +00:00
Ryan C. Gordon
e5326a7e96 Create a 2D window and then manually focus a different window on your desktop,
call SDL_PumpEvents() so the X11 driver sets its this->hidden->switch_waiting,
then set a fullscreen OpenGL window (which makes the X11 driver tear down and
create a new window instead of just resizing the existing one), poll for
events, and the newly-created window will think it needs to pop back to a
window. Fixed by resetting switch_waiting to zero if X11_CreateWindow() had
to tear down a previous window.
2004-02-26 15:12:51 +00:00
Sam Lantinga
743d10080e This works on MacOS X too. :) 2004-02-26 14:26:07 +00:00
Sam Lantinga
c1005d13dc Date: Wed, 25 Feb 2004 06:41:17 -0500
From: "Ryan C. Gordon"
Subject: Re: MacOS X bugs...

This isn't an ideal patch (trying to open a joystick that has previously
been unplugged will report success, but it'll just never give any input,
etc), but it handles the worst case of deadlock in the event subsystem.
2004-02-26 13:45:22 +00:00
Ryan C. Gordon
bb1cddfaed Attempt to get FSAA compiling on all versions of MacOS X. 2004-02-26 08:57:32 +00:00
Sam Lantinga
1904a7ac4c Date: Mon, 23 Feb 2004 19:00:23 +0100
From: "Juergen \"George\" Sawinski"
Subject: Problems compiling libsdl with gcc 3.3

I attached another patch (configure.in.patch) that might resolv issues
for some ppl finding the correct place of libartsc.so.*.
(here, the output of "artsc-config --libs" contains two "-L.*",
therefore the respecting arts_lib_spec contains the wrong path).
2004-02-24 19:22:22 +00:00
Sam Lantinga
75bc1cc2b7 I noticed MacOSX SDL sets up working directory to parent of executable.
On BeOS is should setup it the same way, but it only does when Tracker
wasn't restarted.

I checked code and it looks like a hack to me :(
It looks for env variable and than comapres it to default when OpenTracker
was started after boot, and wasn't restarted. That's probably ok, for that
exact case. Unfortunetly that variable isn't always like that. For
example, after Tracker crashes and is restarted, env variable most
probably is different (depends on how Tracker was restarted, by what
application, etc... for example: i have launcher application from which i
can restart Tracker, and after that nev variable points to that
application's directory, not Tracker's).
2004-02-24 18:58:40 +00:00
Sam Lantinga
844d72f37c *** empty log message *** 2004-02-24 16:21:19 +00:00
Sam Lantinga
4db5f3decc Don't allow video modes larger than the maximum size 2004-02-24 07:42:19 +00:00
Ryan C. Gordon
a4382ccbb7 Quartz fix:
ut2004 makes a 2D window for the splash screen, which sets the screen
surface's pixels field. Then we tear down that video mode and create a GL
context, and the Quartz target isn't resetting the pixels field to NULL.

When you just create a GL window, the structure is memset'd to zero the
first time through, so unless you hit ut2004's codepath, you won't see the
bug.  :)

Without this patch, quitting a windowed ut2003/ut2004 game makes the OS dump a
warning about a bogus free() to stderr, but it doesn't actually crash. All we
need to do is explicitly initialize the current->pixels field.
2004-02-24 06:53:22 +00:00
Sam Lantinga
acea3c774d Doh! 2004-02-23 15:49:28 +00:00
Sam Lantinga
760068f108 Added an endian detection and byte swapping test program 2004-02-23 08:03:14 +00:00
Sam Lantinga
2838191e14 Added inline byte swapping code for other architectures 2004-02-23 06:09:21 +00:00
Sam Lantinga
cfeddcb5ca Avoid using kernel internal headers 2004-02-23 05:32:52 +00:00
Sam Lantinga
2099bf54a1 *** empty log message *** 2004-02-21 00:21:06 +00:00
Sam Lantinga
f4baa32414 *** empty log message *** 2004-02-20 18:18:20 +00:00
Sam Lantinga
d2a487772f Fixed a bug in detecting surface mapping changes 2004-02-19 21:13:24 +00:00
Sam Lantinga
9e02d4aecb *** empty log message *** 2004-02-18 03:57:13 +00:00
Sam Lantinga
785e6c2328 Updated SDL_opengl.h to include the latest version of glext.h 2004-02-17 23:29:52 +00:00
Sam Lantinga
f242b7e778 Load the correct library on Windows 2004-02-17 22:04:44 +00:00
Sam Lantinga
d0fb7b6372 *** empty log message *** 2004-02-17 22:00:33 +00:00
Sam Lantinga
215d2d8073 *** empty log message *** 2004-02-17 18:21:46 +00:00
Sam Lantinga
97b5d3bc6e Added a test program for dynamically loading OpenGL 2004-02-17 18:16:49 +00:00
Sam Lantinga
4eda6a12bb *** empty log message *** 2004-02-17 18:01:39 +00:00
Sam Lantinga
f9eb3341b9 *** empty log message *** 2004-02-17 16:19:29 +00:00
Sam Lantinga
6c5a569eb8 *** empty log message *** 2004-02-17 04:48:16 +00:00
Sam Lantinga
9241ef2292 *** empty log message *** 2004-02-17 04:47:25 +00:00