Commit graph

100 commits

Author SHA1 Message Date
Sam Lantinga
8f9aba9215 The X11 window and all pixmaps and images share the same visual and depth.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403332
2008-12-14 04:36:32 +00:00
Sam Lantinga
0c30a927ed Updated copyright date
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403321
2008-12-08 00:27:32 +00:00
Sam Lantinga
cc0b655042 Initial work on X11 window code in.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401997
2006-07-27 06:53:23 +00:00
Sam Lantinga
3ec5d40b87 Started work on the new X11 driver.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401996
2006-07-26 06:34:54 +00:00
Sam Lantinga
532023bd76 Starting fresh with the X11 driver
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401994
2006-07-26 04:22:32 +00:00
Sam Lantinga
0f030a1802 SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401938
2006-07-10 21:04:37 +00:00
Sam Lantinga
d565a14593 Fixed bug #241
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401858
2006-06-20 05:25:04 +00:00
Sam Lantinga
3a0d72c6e5 Fixed bug #217
Sort the DirectX video modes largest to smallest

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401730
2006-05-07 04:02:48 +00:00
Sam Lantinga
cab8a203a7 Fixed bug #80
Date: 21 Apr 2003 17:20:20 +0100
From: Alan Swanson <swanson@uklinux.net>
Subject: [SDL] New XFree 4.3 Video Mode Patch


If you look at the unsorted list of modes returned by X, here's mine;

 1280 x 1024 @ 85.0  >
 1024 x 768 @ 100.3  > USER
 800 x 600 @ 125.5   > SET
 640 x 480 @ 124.9   >
 1280 x 1024 @ 75.0  ]
 1280 x 1024 @ 60.0  ]
 1280 x 960 @ 85.0   ] X11
 1280 x 960 @ 60.0   ] AUTO
 1152 x 864 @ 75.0   ]=20
 1152 x 768 @ 54.8   ]
 960 x 720 @ 120.0   ]
...
 640 x 400 @ 85.1    ] 256k
 576 x 432 @ 150.0   ] 249k PIXEL
 640 x 350 @ 85.1    ] 224k COUNT
 576 x 384 @ 109.6   ] 221k
...

The user set modes come first followed by X set modes which are ordered
by decreasing number of pixels and refresh.

The reason why every other library or program not using SDL working is
due to SDL scanning the modes in reverse getting X11 provided modes
modes with the lowest refresh.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401727
2006-05-05 05:50:26 +00:00
Sam Lantinga
732fcc2ab0 --HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401725
2006-05-04 16:52:53 +00:00
Sam Lantinga
daab242a93 Fixed bug #45
Improved Xinerama support.
Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment variable, currently supported on X11 Xinerama configurations.
Only use the VidMode extension on the primary head.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401724
2006-05-04 16:51:07 +00:00
Sam Lantinga
2efcd9c6dc --HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401705
2006-04-29 17:56:06 +00:00
Sam Lantinga
41c2e03aa4 Disable the XRandR extension by default, since KDE maximizes windows which are larger than the new resolution, and then doesn't restore their size and positition when the old resolution is restored.
The extension can be enabled with the environment variable SDL_VIDEO_X11_XRANDR=1

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401704
2006-04-29 17:54:32 +00:00
Sam Lantinga
fccd61bcf4 Fixed bug #197
On servers with the composite extension enabled, visuals with 32-bit depth
have an alpha mask.  This is pretty neat, but SDL needs a bit more work to
handle these properly, so for now, we'll just use 24 bit depth visuals.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401648
2006-04-17 04:54:08 +00:00
Ryan C. Gordon
be7a5193c8 Xrandr support in the X11 target.
Fixes Bugzilla #109, and as a bonus, Bugzilla #145, too!

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401594
2006-03-22 11:13:58 +00:00
Ryan C. Gordon
8487ec6692 Updated dynamic X11 code. See details in Bugzilla #170.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401579
2006-03-22 05:00:59 +00:00
Sam Lantinga
ab022a8987 Added current_w and current_h to the SDL_VideoInfo structure, which is set to the desktop resolution during video intialization, and then set to the current resolution when a video mode is set.
SDL_SetVideoMode() now accepts 0 for width or height and will use the current video mode (or the desktop mode if no mode has been set.)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401549
2006-03-15 17:46:41 +00:00
Sam Lantinga
c36118165e Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401406
2006-02-21 08:46:50 +00:00
Sam Lantinga
1da8cb0143 Use only safe string functions
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401383
2006-02-19 23:46:34 +00:00
Sam Lantinga
d3805eef09 New configure-based build system. Still work in progress, but much improved
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401365
2006-02-16 10:11:48 +00:00
Sam Lantinga
684909fae2 More header massaging... works great on Windows. ;-)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401362
2006-02-10 06:48:43 +00:00
Sam Lantinga
09cd73f1b5 Removed uses of stdlib.h and string.h
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401342
2006-02-07 09:29:18 +00:00
Sam Lantinga
5d53175e4d Use SDL_ prefixed versions of C library functions.
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401340
2006-02-07 06:59:48 +00:00
Sam Lantinga
67ecc5318b Eliminate duplicate modes with different refresh rates
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401321
2006-02-01 09:28:42 +00:00
Sam Lantinga
eea4857268 Updated copyright information and removed rcs id lines (problematic in branch merges)
I batch edited these files, so please let me know if I've accidentally removed anybody's
credit here.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401315
2006-02-01 06:32:25 +00:00
Ryan C. Gordon
dc8dc16fd6 Changed references to XFree86 to Xext to match change in directory structure.
Reference Bugzilla #116.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401309
2006-01-31 18:39:32 +00:00
Sam Lantinga
3fb937938e Hopefully the X servers have been fixed (in 5 years) :)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401265
2006-01-25 06:12:57 +00:00
Sam Lantinga
81b8c57ff2 Fixed compile warnings with gcc 4
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401199
2005-12-08 14:21:17 +00:00
Ryan C. Gordon
0d4d13b23f Dynamically load X11 libraries like we currently do for alsa, esd, etc.
This allows you to run an SDL program on a system without Xlib, since it'll
 just report the x11 target unavailable at runtime.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401171
2005-11-05 19:53:37 +00:00
Sam Lantinga
9dd9471dc3 Video modes are sorted width first, then height
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40967
2004-11-12 21:25:42 +00:00
Sam Lantinga
cb9c2efd17 Updated copyright information for 2004 (Happy New Year!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40770
2004-01-04 16:49:27 +00:00
Sam Lantinga
cbe781b5ab Fixed X11 mode line crash with only one video mode (thanks Alan!)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40714
2003-09-05 15:18:46 +00:00
Sam Lantinga
3f73ea75d2 Date: 28 Jun 2003 22:42:52 +0100
From: Alan Swanson
Subject: Re: [SDL] New XFree 4.3 Video Mode Patch

I have a wee amendment that moves the qsort in set_best_resolution
to only occur after failing to find an exact match only. This would
make absolutely sure we get a user set mode.

While I've never had any problems for my normal resolutions (1280x1024,
1024x768, 800x600 & 640,480) while closely examining the output from
qsort I've noticed it doesn't seem to sort the modes fully. These is
one definite wrong at 1152x768 and a few that just look wrong to me.

From a program (attached) I made to examine this more easily. X has
sorted its mode list using the same method as ours (plus frequency),
and our user modes get inserted without any other movement.

On the patch I've made I've also changed cmpmodes to sort on vertical
resolution and then horizontal. Ie vertical is now most significant
bit.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40642
2003-06-28 21:52:26 +00:00
Sam Lantinga
31731b66ce te: 27 Jun 2003 21:16:01 +0100
From: Alan Swanson
Subject: [SDL] New XFree 4.3 Video Mode Patch

The current patch to fix the issues with XFree 4.3 it is a bit of
overkill to a simple problem. Default screen settings should be set in
X, not selected by SDL with environment variables. Any program or user
using non-standard or unset display modes get what they deserve :-)

If you look at the unsorted list of modes returned by X, here's mine;

 1280 x 1024 @ 85.0  >
 1024 x 768 @ 100.3  > USER
 800 x 600 @ 125.5   > SET
 640 x 480 @ 124.9   >
 1280 x 1024 @ 75.0  ]
 1280 x 1024 @ 60.0  ]
 1280 x 960 @ 85.0   ] X11
 1280 x 960 @ 60.0   ] AUTO
 1152 x 864 @ 75.0   ]
 1152 x 768 @ 54.8   ]
 960 x 720 @ 120.0   ]
...
 640 x 400 @ 85.1    ] 256k
 576 x 432 @ 150.0   ] 249k PIXEL
 640 x 350 @ 85.1    ] 224k COUNT
 576 x 384 @ 109.6   ] 221k
...

The user set modes come first followed by X set modes which are ordered
by decreasing number of pixels and refresh.

The reason why every other library or program not using SDL was working
is due to SDL scanning the modes in reverse getting X11 provided modes
modes with the lowest refresh.

The solution is to scan forward for the first user set mode or highest X
mode. The qsort still keeps user set modes above higher refresh modes
added by X.

For the best match we still reverse search for the nearest larger size
and then try to find a higher version of it.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40638
2003-06-28 17:16:52 +00:00
Sam Lantinga
bedc128ac0 Date: Wed, 9 Apr 2003 18:21:33 -0230
From: Stephen Anthony <stephena@roadrunner.nf.net>
Subject: [SDL] First patch concerning  4.3 and refresh rates

OK, here's my first draft of the patch for the above subject.

A short explanation:

X 4.3 introduces many more modelines than older versions.  This would be
fine, except it introduces many modes with the *same* resolution but
different refresh rates.  And SDL won't necessarily pick the one with the
highest refresh rate.

So this patch restores SDL to X 4.2 functionality.  That is, there is only
ever one refresh rate *per* resolution, and it is the highest possible.
This functionality can be totally disabled by using the environment
variable 'SDL_VIDEO_X11_USE_ALL_MODES' set equal to 1.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40615
2003-04-20 05:36:52 +00:00
Sam Lantinga
429aea3075 Date: Sat, 1 Mar 2003 16:13:57 -0500
From: Wilbern Cobb
Subject: OpenBSD/sparc64 video init fix

This patch fixes remote X sessions on OpenBSD/sparc64.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40608
2003-03-06 06:22:33 +00:00
Sam Lantinga
bb0214c5a3 Date: Mon, 24 Feb 2003 16:31:25 -0500
From: Ragnvald "Despair" Maartmann-Moe IV
Subject: SDL x11 video mode selection bug

Hi, I've found an oddity with video mode selection. I recently added a bunch of
oddball video modes to my XF86Config, to support weird resolutions xine &
mplayer need if I don't want to beat my cpu up with video scaling.

Since adding them, SDL started picking the biggest video mode it could find
that matched the height constraint. Getting a narrow vertical strip of
QuakeForge (I code for the project, so needless to say it's my favorite test)
in the middle of an 800x480 screen, instead of the 640x480 I asked for
annoys me tremendously.

So here's a patch that tries a bit harder to get an exact match. I didn't
touch the XiG section, since I can't test that, but I'd bet a similar patch
would prevent similar problems there.

--Ragnvald "Despair" Maartmann-Moe IV

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40605
2003-03-06 06:02:16 +00:00
Sam Lantinga
e001f91de4 Added an aborted try at making fullscreen work on Xinerama screen != 0
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40500
2002-09-30 00:35:25 +00:00
Sam Lantinga
ea5d630479 Updated copyright information for 2002
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40298
2002-03-06 11:23:08 +00:00
Sam Lantinga
a1db24829f Added SDL_LockRect() and SDL_UnlockRect()
Incorporated XFree86 extension libraries into the source

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40293
2002-03-05 19:55:32 +00:00
Sam Lantinga
3ceea60069 Updated the source with the correct e-mail address
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40253
2001-12-14 12:38:15 +00:00
Sam Lantinga
ea3595e3fb Added support for Xi Graphics XME fullscreen extension
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40243
2001-11-22 04:55:38 +00:00
Sam Lantinga
a18f9fc0f8 Greatly improved Xinerama video mode support
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40231
2001-11-04 04:18:43 +00:00
Sam Lantinga
c05194de44 Added X11 Xinerama support - fullscreen starts on screen 0
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40228
2001-11-03 17:03:16 +00:00
Sam Lantinga
a169a6c32e Fixed using the video mode extension on older servers
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40101
2001-07-11 20:18:52 +00:00
Sam Lantinga
d8a033f83d Fixed some problems with the fullscreen code. Wooo. :)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4099
2001-07-09 22:36:16 +00:00
Sam Lantinga
6369aeaaa5 From: "Markus F.X.J. Oberhumer"
Subject: SDL CVS patches

below you will find some small patches against the
current SDL CVS.

It adresses these things:

1) Use "&" instead of "%" in some cases. For negative
   signed integers (x % 8) is not always (x & 7),
   and the compiler can produce slightly faster
   code when using "&" here.

2) Some const issues.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4092
2001-07-07 20:20:17 +00:00
Sam Lantinga
b4001bd1ff Fix to allow SDL compiled under XFree v4 to work with XFree v3 xservers.
Contributed by Jarek Sobieszek

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4091
2001-07-07 08:08:42 +00:00
Sam Lantinga
96c6144609 Hopefully fixed the fullscreen mode code for KDE
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4089
2001-07-07 07:59:37 +00:00
Sam Lantinga
2f110628a7 Initial revision
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401
2001-04-26 16:45:43 +00:00