diff -Naur SDL12.orig/configure.in SDL12/configure.in
--- SDL12.orig/configure.in	2004-05-07 14:06:44.000000000 +0200
+++ SDL12/configure.in	2004-08-11 02:16:09.000000000 +0200
@@ -1046,6 +1046,10 @@
 [  --enable-video-opengl   include OpenGL context creation [default=yes]],
               , enable_video_opengl=yes)
 
+AC_ARG_ENABLE(video-glscale,
+[  --enable-video-glscale  use OpenGL scaling driver [default=yes]],
+              , enable_video_glscale=yes)
+
 dnl Find OpenGL
 CheckOpenGL()
 {
@@ -1066,6 +1070,11 @@
             if test x$use_dlopen != xyes; then
                 AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
             fi
+            if test x$enable_video_glscale = xyes; then
+                VIDEO_SUBDIRS="$VIDEO_SUBDIRS glscale"
+                VIDEO_DRIVERS="$VIDEO_DRIVERS glscale/libvideo_glscale.la"
+                CFLAGS="$CFLAGS -DENABLE_GLSCALE"
+            fi
         fi
     fi
 }
@@ -2791,6 +2800,7 @@
 src/video/fbcon/Makefile
 src/video/gem/Makefile
 src/video/ggi/Makefile
+src/video/glscale/Makefile
 src/video/maccommon/Makefile
 src/video/macdsp/Makefile
 src/video/macrom/Makefile
diff -Naur SDL12.orig/src/video/glscale/Makefile.am SDL12/src/video/glscale/Makefile.am
--- SDL12.orig/src/video/glscale/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ SDL12/src/video/glscale/Makefile.am	2004-08-11 02:16:26.000000000 +0200
@@ -0,0 +1,10 @@
+
+## Makefile.am for SDL using the glscale video driver
+
+noinst_LTLIBRARIES = libvideo_glscale.la
+libvideo_glscale_la_SOURCES = $(GLSCALE_SRCS)
+
+# The glscale video driver sources
+GLSCALE_SRCS = 	\
+	SDL_glscale.c	\
+	SDL_glscale.h
diff -Naur SDL12.orig/src/video/glscale/SDL_glscale.c SDL12/src/video/glscale/SDL_glscale.c
--- SDL12.orig/src/video/glscale/SDL_glscale.c	1970-01-01 01:00:00.000000000 +0100
+++ SDL12/src/video/glscale/SDL_glscale.c	2004-08-11 02:16:26.000000000 +0200
@@ -0,0 +1,652 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/*
+ * GLSCALE video driver implemented by Stephane Marchesin
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SDL.h"
+#include "SDL_error.h"
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "SDL_sysvideo.h"
+#include "SDL_pixels_c.h"
+#include "SDL_events_c.h"
+#include "SDL_glscale.h"
+#include "SDL_blit.h"
+
+#define GLSCALEVID_DRIVER_NAME "glscale"
+
+/* the real screen size, i.e. the window size after scaling */
+int screen_width;
+int screen_height;
+
+/* the screen size from the application's viewpoint */
+int original_screen_width;
+int original_screen_height;
+
+
+float x_factor,y_factor;
+
+/* Initialization/Query functions */
+static SDL_Rect **GLSCALE_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *GLSCALE_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int GLSCALE_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void GLSCALE_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int GLSCALE_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int GLSCALE_LockHWSurface(_THIS, SDL_Surface *surface);
+static void GLSCALE_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void GLSCALE_FreeHWSurface(_THIS, SDL_Surface *surface);
+static int GLSCALE_FlipHWSurface(_THIS, SDL_Surface *surface);
+
+/* etc. */
+static void GLSCALE_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+
+/* some variables */
+GLuint gl_texture;
+SDL_PixelFormat* pix;
+int tex_x,tex_y;
+
+void ( * eglColorTableEXT) (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+
+/* the rendering methods */
+typedef enum 
+{
+	method_default,
+	method_8,
+	method_15,
+	method_16,
+	method_24,
+	method_24_rev,
+	method_32,
+	method_32_rev
+} method_type;
+method_type method;
+SDL_Surface* conv;
+
+/* check for an OpenGL extension */
+int have_gl_extension (_THIS, char *nom_ext)
+{
+	const char *ext;
+	ext = (const char *) (this->glGetString (GL_EXTENSIONS));
+	const char *f;
+	if (ext == NULL)
+		return 0;
+	f = ext + strlen (ext);
+	while (ext < f)
+	{
+		unsigned int n = strcspn (ext, " ");
+		if ((strlen (nom_ext) == n) && (strncmp (nom_ext, ext, n) == 0))
+			return 1;
+		ext += (n + 1);
+	}
+	return 0;
+}
+
+
+/* 
+ * List of video drivers known to support OpenGL. 
+ * The purpose of this is to make GLSCALE "portable" across all video 
+ * backends that support OpenGL by "hooking" other backends
+ */
+static VideoBootStrap *opengl_bootstrap = 
+#ifdef ENABLE_X11
+	&X11_bootstrap
+#else
+#ifdef ENABLE_WINDIB
+	&WINDIB_bootstrap
+#else
+#ifdef ENABLE_BWINDOW
+	&BWINDOW_bootstrap
+#else
+#ifdef ENABLE_QUARTZ
+	&QZ_bootstrap
+#else
+#ifdef ENABLE_CYBERGRAPHICS
+	&CGX_bootstrap
+#else
+#ifdef ENABLE_PHOTON
+	&ph_bootstrap
+#else
+#ifdef ENABLE_DC
+	&DC_bootstrap
+#else
+	NULL
+#endif /* x11 */
+#endif /* win */
+#endif /* be */
+#endif /* quartz */
+#endif /* cgx */
+#endif /* photon */
+#endif /* dc */
+;
+
+/* GLSCALE driver bootstrap functions */
+static int GLSCALE_Available(void)
+{
+	if (opengl_bootstrap==NULL)
+		return 0;
+	return (opengl_bootstrap->available());
+}
+
+static void GLSCALE_DeleteDevice(SDL_VideoDevice *device)
+{
+	free(device->hidden);
+	free(device);
+}
+
+SDL_VideoDevice underlying_device;
+
+static SDL_VideoDevice *GLSCALE_CreateDevice(int devindex)
+{
+	SDL_VideoDevice *device;
+
+	/* Create the device with the underlying driver */
+	device = opengl_bootstrap->create(devindex);
+
+	/* Save the video device contents for future use */
+	memcpy(&underlying_device,device,sizeof(SDL_VideoDevice));
+
+	/* Set the function pointers */
+	device->ListModes = GLSCALE_ListModes;
+	device->SetVideoMode = GLSCALE_SetVideoMode;
+	device->CreateYUVOverlay = NULL;
+	device->SetColors = GLSCALE_SetColors;
+	device->UpdateRects = GLSCALE_UpdateRects;
+	device->VideoQuit = GLSCALE_VideoQuit;
+	device->AllocHWSurface = GLSCALE_AllocHWSurface;
+	device->CheckHWBlit = NULL;
+	device->FillHWRect = NULL;
+	device->SetHWColorKey = NULL;
+	device->SetHWAlpha = NULL;
+	device->LockHWSurface = GLSCALE_LockHWSurface;
+	device->UnlockHWSurface = GLSCALE_UnlockHWSurface;
+	device->FlipHWSurface = GLSCALE_FlipHWSurface;
+	device->FreeHWSurface = GLSCALE_FreeHWSurface;
+	device->SetCaption = NULL;
+	device->SetIcon = NULL;
+	device->IconifyWindow = NULL;
+	device->GrabInput = NULL;
+	device->GetWMInfo = NULL;
+
+	/* No hw acceleration */
+	device->info.blit_hw=0;
+	device->info.blit_hw_CC=0;
+	device->info.blit_hw_A=0;
+	device->info.blit_sw=0;
+	device->info.blit_sw_CC=0;
+	device->info.blit_sw_A=0;
+	device->info.blit_fill=0;
+
+	device->free = GLSCALE_DeleteDevice;
+
+	return device;
+}
+
+VideoBootStrap GLSCALE_bootstrap = {
+	GLSCALEVID_DRIVER_NAME, "GLSCALE video driver",
+	GLSCALE_Available, GLSCALE_CreateDevice
+};
+
+
+SDL_Rect **GLSCALE_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+   	 return (SDL_Rect **) -1;
+}
+
+SDL_Surface *GLSCALE_SetVideoMode(_THIS, SDL_Surface *current,
+				int width, int height, int bpp, Uint32 flags)
+{
+	SDL_Surface* video_surface;
+	char *xs;
+	char *ys;
+	int major, minor;
+	const char *version;
+	int flag_doublebuf=0;
+	
+	/* we don't have OpenGL */
+	if ((flags&SDL_OPENGL)==SDL_OPENGL)
+		return(NULL);
+	
+	xs=getenv("SDL_VIDEODRIVER_GLSCALE_X");
+	ys=getenv("SDL_VIDEODRIVER_GLSCALE_Y");
+	
+	/* 2x scaling by default */
+	if (xs==NULL)
+		screen_width=2*width;
+	else
+		screen_width=atoi(xs);
+	
+	if (ys==NULL)
+		screen_height=2*height;
+	else
+		screen_height=atoi(ys);
+
+	x_factor=(float)screen_width/(float)width;
+	y_factor=(float)screen_height/(float)height;
+	
+	/* No doublebuffer, we don't need it */
+	SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 0);
+
+	if (flags&SDL_DOUBLEBUF)
+		flag_doublebuf=1;
+	else
+		flag_doublebuf=0;
+
+	
+	video_surface=underlying_device.SetVideoMode(this,current,screen_width,screen_height,0,flags|SDL_OPENGL);
+	if (!video_surface)
+		return NULL;
+
+	/* Here we have to setup OpenGL funcs ourselves */
+#ifndef __QNXNTO__
+#define SDL_PROC(ret,func,params) \
+do { \
+	this->func = SDL_GL_GetProcAddress(#func); \
+	if ( ! this->func ) { \
+		SDL_SetError("Couldn't load GL function: %s\n", #func); \
+		return(NULL); \
+	} \
+} while ( 0 );
+#else
+#define SDL_PROC(ret,func,params) this->func=func;
+#endif /* __QNXNTO__ */
+#include "../SDL_glfuncs.h"
+#undef SDL_PROC	
+	
+	if ( this->GL_MakeCurrent(this) < 0 )
+		return(NULL);
+
+#define SDL_PROC(ret,func,params) \
+do { \
+	this->func = SDL_GL_GetProcAddress(#func); \
+	if ( ! this->func ) { \
+		SDL_SetError("Couldn't load GL function: %s\n", #func); \
+		return(NULL); \
+	} \
+} while ( 0 );
+#include "../SDL_glfuncs.h"
+#undef SDL_PROC	
+
+	this->glEnable(GL_TEXTURE_2D);
+	this->glGenTextures(1, &gl_texture);
+	this->glBindTexture(GL_TEXTURE_2D, gl_texture);
+	this->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+	this->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+	this->glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+	this->glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+	version = (char *) this->glGetString(GL_VERSION);
+	if (sscanf(version, "%d.%d", &major, &minor) != 2)
+		return NULL;
+
+	
+	tex_x=1;
+	do
+	{
+		tex_x=tex_x<<1;
+	}
+	while(tex_x<width);
+	tex_y=1;
+	do
+	{
+		tex_y=tex_y<<1;
+	}
+	while(tex_y<height);
+
+		
+	method=method_default;
+	switch(bpp)
+	{
+		case 8:
+			if (have_gl_extension(this,"GL_EXT_paletted_texture")&&(eglColorTableEXT=SDL_GL_GetProcAddress("glColorTableEXT")))
+			{
+				method=method_8;
+				this->glTexImage2D(GL_TEXTURE_2D, 0,GL_COLOR_INDEX8_EXT,tex_x,tex_y, 0,
+					GL_COLOR_INDEX,
+					GL_UNSIGNED_BYTE,NULL);
+			}
+			else
+				method=method_default;
+			break;
+		case 15:
+			if (major >= 1 && minor >= 2)
+			{
+				this->glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB5,tex_x,tex_y, 0,
+						GL_RGB,
+						GL_UNSIGNED_SHORT_5_5_5_1,NULL);
+				method=method_15;
+			}
+			break;
+		case 16:
+			if (major >= 1 && minor >= 2)
+			{
+				this->glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB5,tex_x,tex_y, 0,
+						GL_RGB,
+						GL_UNSIGNED_SHORT_5_6_5,NULL);
+				method=method_16;
+			}
+			break;
+		case 24:
+			if (major >= 1 && minor >= 2)
+			{
+				this->glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB,tex_x,tex_y, 0,
+						GL_BGR,
+						GL_UNSIGNED_BYTE,NULL);
+				method=method_24_rev;
+			}
+			else
+			{
+				this->glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB,tex_x,tex_y, 0,
+						GL_RGB,
+						GL_UNSIGNED_BYTE,NULL);
+				method=method_24;
+			}
+			break;
+		case 32:
+			if (major >= 1 && minor >= 2)
+			{
+				this->glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB,tex_x,tex_y, 0,
+						GL_BGRA,
+						GL_UNSIGNED_BYTE,NULL);
+				method=method_32_rev;
+			}
+			else
+			{
+				this->glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB,tex_x,tex_y, 0,
+						GL_RGBA,
+						GL_UNSIGNED_BYTE,NULL);
+				method=method_32;
+			}
+			break;
+	}
+	if (method==method_default)
+	{
+		this->glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB,tex_x,tex_y, 0,
+				GL_RGB,
+				GL_UNSIGNED_BYTE,NULL);
+		conv=SDL_CreateRGBSurface(SDL_SWSURFACE,
+			width,
+			height,
+			24,
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+			0x000000FF,
+			0x0000FF00,
+			0x00FF0000,
+			0x00000000
+#else
+			0x00FF0000,
+			0x0000FF00,
+			0x000000FF,
+			0x00000000
+#endif
+			);
+	}		
+
+#ifdef DEBUG
+	printf("Using method %d\n",method);
+#endif
+
+	this->glViewport(0,0,screen_width,screen_height);
+	this->glMatrixMode(GL_PROJECTION);
+	this->glLoadIdentity();
+	this->glOrtho(0,screen_width,screen_height,0,-1.0, 1.0);
+	
+	video_surface->w=width;
+	video_surface->h=height;
+	video_surface->format=SDL_AllocFormat(bpp,0,0,0,0);
+	video_surface->pitch=SDL_CalculatePitch(video_surface);
+	video_surface->pixels=malloc(video_surface->h*video_surface->pitch);
+	video_surface->flags&=~SDL_OPENGL;
+	if (flag_doublebuf)
+		video_surface->flags|=SDL_DOUBLEBUF;
+
+
+	/* We're done */
+	return(video_surface);
+}
+
+/* We don't actually allow hardware surfaces */
+static int GLSCALE_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+	return(-1);
+}
+static void GLSCALE_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+	return;
+}
+
+static int GLSCALE_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+	if (surface==SDL_VideoSurface)
+		return(0);
+	else
+		return underlying_device.LockHWSurface(this,surface);
+}
+
+static void GLSCALE_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+	if (surface==SDL_VideoSurface)
+		return;
+	else
+		underlying_device.UnlockHWSurface(this,surface);
+}
+
+static void GLSCALE_CreateTexture(_THIS, SDL_Surface *surface, SDL_Rect* rect)
+{
+
+	this->glBindTexture(GL_TEXTURE_2D, gl_texture);
+	this->glPixelStorei(GL_UNPACK_SKIP_PIXELS,rect->x);
+	this->glPixelStorei(GL_UNPACK_SKIP_ROWS,rect->y);
+	this->glPixelStorei(GL_UNPACK_ROW_LENGTH,surface->pitch/surface->format->BytesPerPixel);
+
+	/* create & upload a texture with an SDL surface */
+	switch(method)
+	{
+		case method_default:
+		{
+			/* copy rect, since SDL_BlitSurface overwrites it */
+			SDL_Rect r;
+			r.x=rect->x;
+			r.y=rect->y;
+			r.w=rect->w;
+			r.h=rect->h;
+			/* this is the only method needing a conversion */
+			/* copy the changed part and convert the pixel format to RGB8 */
+			SDL_InvalidateMap(surface->map);
+			SDL_BlitSurface(surface,rect,conv,&r);
+			
+			this->glPixelStorei(GL_UNPACK_SKIP_PIXELS,r.x);
+			this->glPixelStorei(GL_UNPACK_SKIP_ROWS,r.y);
+			this->glPixelStorei(GL_UNPACK_ROW_LENGTH,conv->pitch/conv->format->BytesPerPixel);
+			this->glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,r.w, r.h,GL_RGB, GL_UNSIGNED_BYTE,conv->pixels);
+			break;
+		}
+		case method_8:
+		{
+			int i;
+			Uint8* pal=(Uint8*)malloc(sizeof(Uint8)*256*3);
+			for(i=0;i<256;i++)
+			{
+				pal[3*i  ] = surface->format->palette->colors[i].r;
+				pal[3*i+1] = surface->format->palette->colors[i].g;
+				pal[3*i+2] = surface->format->palette->colors[i].b;
+			}
+			eglColorTableEXT(GL_TEXTURE_2D,GL_RGB8,256,GL_RGB,GL_UNSIGNED_BYTE,pal);
+			free(pal);
+			this->glTexSubImage2D(GL_TEXTURE_2D,0,0,0,
+				rect->w, rect->h,
+				GL_COLOR_INDEX,GL_UNSIGNED_BYTE,
+				surface->pixels);
+		}
+		break;
+		case method_15:
+		this->glTexSubImage2D(GL_TEXTURE_2D,0,0,0,
+				rect->w, rect->h,
+				GL_RGB,GL_UNSIGNED_SHORT_5_5_5_1,
+				surface->pixels
+				);
+		break;
+		case method_16:
+		this->glTexSubImage2D(GL_TEXTURE_2D,0,0,0,
+				rect->w, rect->h,
+				GL_RGB,GL_UNSIGNED_SHORT_5_6_5,
+				surface->pixels
+				);
+		break;
+		case method_24:
+		this->glTexSubImage2D(GL_TEXTURE_2D,0,0,0,
+				rect->w, rect->h,
+				GL_RGB,GL_UNSIGNED_BYTE,
+				surface->pixels
+				);
+		break;
+		case method_24_rev:
+		this->glTexSubImage2D(GL_TEXTURE_2D,0,0,0,
+				rect->w, rect->h,
+				GL_BGR,GL_UNSIGNED_BYTE,
+				surface->pixels
+				);
+		break;
+		case method_32:
+		this->glTexSubImage2D(GL_TEXTURE_2D,0,0,0,
+				rect->w, rect->h,
+				GL_RGBA,GL_UNSIGNED_BYTE,
+				surface->pixels
+				);
+		break;
+		case method_32_rev:
+		this->glTexSubImage2D(GL_TEXTURE_2D,0,0,0,
+				rect->w, rect->h,
+				GL_BGRA,GL_UNSIGNED_BYTE,
+				surface->pixels
+				);
+		break;
+	}
+}
+
+
+static int GLSCALE_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+	SDL_Rect r;
+	r.x=0;
+	r.y=0;
+	r.w=surface->w;
+	r.h=surface->h;		
+		
+	GLSCALE_CreateTexture(this,surface,&r);
+	/* draw ! */
+	this->glBegin(GL_QUADS);
+	this->glColor4f(1.0,1.0,1.0,1.0);
+
+	this->glTexCoord2f(0.f, 0.f);
+	this->glVertex2i(0, 0);
+
+	this->glTexCoord2f(0.f, ((float)surface->h)/tex_y);
+	this->glVertex2i(0, screen_height);
+
+	this->glTexCoord2f(((float)surface->w)/tex_x, ((float)surface->h)/tex_y);
+	this->glVertex2i(screen_width, screen_height);
+
+	this->glTexCoord2f(((float)surface->w)/tex_x, 0.f);
+	this->glVertex2i(screen_width, 0);
+	this->glEnd();
+	this->glFlush();
+
+	return 1;
+}
+
+static void GLSCALE_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+	int i;
+	SDL_Rect rect;
+	int x1,x2,y1,y2;
+	GLfloat tx,ty;
+		
+	for(i=0;i<numrects;i++)
+	{
+		/* we need a border for correct interpolation, but don't go over the screen borders */
+		rect.x=rects[i].x-1;
+		rect.y=rects[i].y-1;
+		rect.w=rects[i].w+3;
+		rect.h=rects[i].h+3;
+		if (rect.x<0)
+			rect.x=0;
+		if (rect.y<0)
+			rect.y=0;
+		if (rect.x+rect.w>=SDL_VideoSurface->w)
+			rect.w=SDL_VideoSurface->w-rect.x;
+		if (rect.y+rect.h>=SDL_VideoSurface->h)
+			rect.h=SDL_VideoSurface->h-rect.y;
+
+		GLSCALE_CreateTexture(this,SDL_VideoSurface,&rect);
+
+		this->glBegin(GL_QUADS);
+		this->glColor4f(1.0,1.0,1.0,1.0);
+
+		/* draw ! */
+		x1=round(((float)(rect.x))*x_factor);
+		x2=round((float)((rect.x+rect.w-1))*x_factor);
+		y1=round(((float)(rect.y))*y_factor);
+		y2=round(((float)(rect.y+rect.h-1))*y_factor);
+		tx=(GLfloat)((float)rect.w-1.)/(tex_x);
+		ty=(GLfloat)((float)rect.h-1.)/(tex_y);
+		
+		this->glTexCoord2f(0., 0.);
+		this->glVertex2i(x1, y1);
+
+		this->glTexCoord2f(0., ty);
+		this->glVertex2i(x1, y2);
+
+		this->glTexCoord2f(tx, ty);
+		this->glVertex2i(x2, y2);
+
+		this->glTexCoord2f(tx, 0.);
+		this->glVertex2i(x2, y1);
+		this->glEnd();
+	}
+	this->glFinish();
+}
+
+int GLSCALE_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+	/* do nothing of note. */
+	return(1);
+}
+
+/* Note:  If we are terminated, this could be called in the middle of
+   another SDL video routine -- notably UpdateRects.
+*/
+void GLSCALE_VideoQuit(_THIS)
+{
+	if (this->screen->pixels != NULL)
+	{
+		free(this->screen->pixels);
+		this->screen->pixels = NULL;
+	}
+	underlying_device.VideoQuit(this);
+}
diff -Naur SDL12.orig/src/video/glscale/SDL_glscale.h SDL12/src/video/glscale/SDL_glscale.h
--- SDL12.orig/src/video/glscale/SDL_glscale.h	1970-01-01 01:00:00.000000000 +0100
+++ SDL12/src/video/glscale/SDL_glscale.h	2004-08-11 02:16:26.000000000 +0200
@@ -0,0 +1,38 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: SDL_x11video.h,v 1.8 2002/03/06 11:23:08 slouken Exp $";
+#endif
+
+#ifndef _SDL_glscale_h
+#define _SDL_glscale_h
+
+#define _THIS	SDL_VideoDevice *this
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+};
+
+#endif
+
diff -Naur SDL12.orig/src/video/Makefile.am SDL12/src/video/Makefile.am
--- SDL12.orig/src/video/Makefile.am	2003-08-22 15:08:15.000000000 +0200
+++ SDL12/src/video/Makefile.am	2004-08-11 02:16:11.000000000 +0200
@@ -9,7 +9,7 @@
                wincommon windib windx5 \
                maccommon macdsp macrom riscos quartz \
                bwindow ps2gs photon cybergfx epoc picogui \
-               ataricommon xbios gem dc qtopia XFree86
+               ataricommon xbios gem dc qtopia XFree86 glscale
 
 DRIVERS = @VIDEO_DRIVERS@
 
diff -Naur SDL12.orig/src/video/SDL_glfuncs.h SDL12/src/video/SDL_glfuncs.h
--- SDL12.orig/src/video/SDL_glfuncs.h	2003-07-23 18:39:29.000000000 +0200
+++ SDL12/src/video/SDL_glfuncs.h	2004-08-11 02:16:12.000000000 +0200
@@ -92,7 +92,7 @@
 SDL_PROC_UNUSED(void,glEvalPoint1,(GLint i))
 SDL_PROC_UNUSED(void,glEvalPoint2,(GLint i, GLint j))
 SDL_PROC_UNUSED(void,glFeedbackBuffer,(GLsizei size, GLenum type, GLfloat *buffer))
-SDL_PROC_UNUSED(void,glFinish,(void))
+SDL_PROC(void,glFinish,(void))
 SDL_PROC(void,glFlush,(void))
 SDL_PROC_UNUSED(void,glFogf,(GLenum pname, GLfloat param))
 SDL_PROC_UNUSED(void,glFogfv,(GLenum pname, const GLfloat *params))
diff -Naur SDL12.orig/src/video/SDL_sysvideo.h SDL12/src/video/SDL_sysvideo.h
--- SDL12.orig/src/video/SDL_sysvideo.h	2004-01-05 04:08:15.000000000 +0100
+++ SDL12/src/video/SDL_sysvideo.h	2004-08-11 02:16:13.000000000 +0200
@@ -414,6 +414,9 @@
 #ifdef ENABLE_RISCOS
 extern VideoBootStrap RISCOS_bootstrap;
 #endif
+#ifdef ENABLE_GLSCALE
+extern VideoBootStrap GLSCALE_bootstrap;
+#endif
 /* This is the current video device */
 extern SDL_VideoDevice *current_video;
 
diff -Naur SDL12.orig/src/video/SDL_video.c SDL12/src/video/SDL_video.c
--- SDL12.orig/src/video/SDL_video.c	2004-07-18 22:04:48.000000000 +0200
+++ SDL12/src/video/SDL_video.c	2004-08-11 02:16:14.000000000 +0200
@@ -120,6 +120,9 @@
 #ifdef ENABLE_RISCOS
     &RISCOS_bootstrap,
 #endif
+#ifdef ENABLE_GLSCALE
+	&GLSCALE_bootstrap,
+#endif
 #ifdef ENABLE_DUMMYVIDEO
 	&DUMMY_bootstrap,
 #endif
