Fri, 30 Apr 2004 18:33:30 +0000Date: Wed, 28 Apr 2004 16:52:41 -0400
Sam Lantinga [Fri, 30 Apr 2004 18:33:30 +0000] rev 885
Date: Wed, 28 Apr 2004 16:52:41 -0400
From: "Damien A"
Subject: testdyngl fix

The test program you included in the latest version of SDL crashes on startup in Window (XP). The reason for this is that OpenGL functions on Windows use the __stdcall calling convention, not the C convention. Placing APIENTRY infront of the * operator solves this problem.

Fri, 23 Apr 2004 14:00:08 +0000Increment version...
Sam Lantinga [Fri, 23 Apr 2004 14:00:08 +0000] rev 884
Increment version...

Sun, 11 Apr 2004 19:54:40 +0000Date: Sat, 10 Apr 2004 02:25:33 -0400
Sam Lantinga [Sun, 11 Apr 2004 19:54:40 +0000] rev 883
Date: Sat, 10 Apr 2004 02:25:33 -0400
From: Glenn Maynard
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.

Sun, 11 Apr 2004 19:52:58 +0000Date: Sun, 11 Apr 2004 13:09:44 +0200
Sam Lantinga [Sun, 11 Apr 2004 19:52:58 +0000] rev 882
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.

Sun, 11 Apr 2004 19:49:34 +0000Date: Tue, 30 Mar 2004 18:18:13 -0600
Sam Lantinga [Sun, 11 Apr 2004 19:49:34 +0000] rev 881
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.

Sun, 11 Apr 2004 19:47:28 +0000Date: Tue, 30 Mar 2004 21:26:47 -0600
Sam Lantinga [Sun, 11 Apr 2004 19:47:28 +0000] rev 880
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

Thu, 08 Apr 2004 21:13:14 +0000Date: Wed, 31 Mar 2004 09:15:57 -0600
Sam Lantinga [Thu, 08 Apr 2004 21:13:14 +0000] rev 879
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.

Thu, 08 Apr 2004 21:06:10 +0000Argh...
Sam Lantinga [Thu, 08 Apr 2004 21:06:10 +0000] rev 878

Sat, 27 Mar 2004 16:15:42 +0000Yack... finally fixed the MacOS X development package ... I hope!
Sam Lantinga [Sat, 27 Mar 2004 16:15:42 +0000] rev 877
Yack... finally fixed the MacOS X development package ... I hope!

Mon, 22 Mar 2004 09:38:20 +0000(Said Max Horn on the SDL mailing list...)
Ryan C. Gordon [Mon, 22 Mar 2004 09:38:20 +0000] rev 876
(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 :-)



(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;

if ((argv[1]) && (strcmp(argv[1], "--grab") == 0))
screen = SDL_SetVideoMode(640, 480, 0, flags);
if (!screen)

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 );
gluPerspective( 45.0f, ratio, 0.1f, 100.0f );
glMatrixMode( GL_MODELVIEW );

// 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))

switch (event.type)
if (event.key.keysym.sym == SDLK_ESCAPE)
done = 1;

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


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);



/* end of test.c ... */