Commit Graph

1295 Commits

Author SHA1 Message Date
Sam Lantinga
f8d589d4aa Date: Fri, 18 Feb 2005 20:49:35 +0200 (EET)
From: ville
Subject: [SDL] Changing, at least some, anonymous enums to named enums.

Howdy,

Could, some if not all, enums be named rather than being anonymous enums?
I ran into troubles with the enum describing event types in SDL_events.h.
The problem is that an anonymous enum cannot be used in C++ templates like
so:

enum { C };

template< typename T >
void
f( T ) {
}


f( C );
2006-01-29 23:14:04 +00:00
Sam Lantinga
937467e40a Added some useful command line arguments for testing 2006-01-29 23:06:05 +00:00
Sam Lantinga
d21e833807 Fixed palette bug on non-WinCE 2006-01-29 22:23:54 +00:00
Sam Lantinga
b48c324bc4 Only save the window position if we're in windowed mode 2006-01-29 22:09:26 +00:00
Sam Lantinga
b2b62100f7 The event code was fine, and calculated the SDL_windowX/Y correctly.
What we really needed to do was avoid doing client rect adjustment on
zoomed windows. :)
2006-01-29 18:17:35 +00:00
Sam Lantinga
443dc46561 Date: Fri, 18 Feb 2005 07:58:00 +0200
From: "Mike Gorchak"
Subject: [SDL] [PATCH] QNX6 and not only QNX6 fixes

1) Update SDL.qpg.in for the QNX 6.3.
4) video/photon/SDL_phyuv.c - fixed bug with swapped U and V planes, using
YV12 mode with radeon cards.
2006-01-29 09:19:55 +00:00
Sam Lantinga
43bec0b020 Cleaned up the app registration stuff a bit 2006-01-29 09:13:36 +00:00
Sam Lantinga
51d713720e Date: Tue, 15 Feb 2005 21:28:48 +0900 (JST)
From: "Michael Leonhard"
Subject: [SDL] resize bug on Win32 and patch

This is my first post to this mailing list.  In this email I will detail a
bug in the behavior of resizable SDL windows on Win32.  Then I will
explain the solution and provide a patch.

Symptoms:

Under Windows, an SDL display created with the SDL_RESIZABLE flag exhibits
quirky behavior when being maximized.  The window is resized to the proper
size, but it is shifted upwards about half the height of the title bar.
Similarly, a window whose origin is above the top of the screen will
spontaneously move its upper-left origin upon being resized.  After two
such resize-induced moves, the title bar will be entirely off the top edge
of the screen.  Subsequently, when the mouse is clicked and released on
the window border, the window will shrink its height spontaneously.  This
height shrinkage occurs even if the user did not resize the border.

To observe this curious situation, please invoke:
SDL-1.2.8/test/testwm.exe -resize

Cause:

A pair of integers, SDL_windowX and SDL_windowY, are defined in
video/wincommon/SDL_sysevents.c.  They are used by the DirectX video
driver and the DIB video driver:
video/windx5/SDL_dx5video.c
video/windib/SDL_dibvideo.c
As I understand the source code, the primary use of these variables is to
create a rectangle that represents the surface area in CLIENT SPACE.
Client space refers to a coordinate system that originates at the upper
left corner of a Win32 Window's drawable area.  This is just inside the
window border and title bar.  This client space rectangle, called bounds,
is subsequently converted to screen space with a call to
AdjustWindowRectEx.  The problem is found in SDL's handling of the
WM_WINDOWPOSCHANGED message.  According to MSDN,

  "The WM_WINDOWPOSCHANGED message is sent to a window whose
   size, position, or place in the Z order has changed as a
   result of a call to the SetWindowPos function or another
   window-management function."

I have confirmed that this message is indeed being sent to the SDL window
when the mouse is clicked on the window border, even if the window border
is not dragged.

In video/wincommon/SDL_sysevents.c, on line 464, in response to the
WM_WINDOWPOSCHANGED message, the (potentially) new client rectangle is
obtained.  This rectangle is translated into screen coordinates and THEN
assigned to the SDL_windowX and Y variables.  Thus screen coordinates are
being assigned to client coordinate variables.  Once this is understood,
the solution is apparent:  assign SDL_windowX and Y before translating the
rectangle to screen coordinates.  This is accomplished by the following
patch.

-Mike_L
2006-01-29 08:50:06 +00:00
Sam Lantinga
9430b28b12 Use the executable directory, not the current directory, for stdio output files 2006-01-29 08:39:35 +00:00
Sam Lantinga
50f352e421 *** empty log message *** 2006-01-29 08:19:27 +00:00
Sam Lantinga
3ac3d4eb74 Report both absolute and relative motion 2006-01-29 08:18:56 +00:00
Sam Lantinga
b938b5724c Date: Fri, 14 Jan 2005 21:52:46 +0100
From: "SkunkGuru"
Subject: [SDL] Repeated mousemotion event on notebook

it seems that every ~500ms something fires a mousemotion event,
but with the same x and y position.
I tryed with both directx and windib video driver.
2006-01-29 08:18:06 +00:00
Sam Lantinga
d02be89754 Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
From: jimrandomh
Subject: [SDL] Re: Modifier keys pressed during initialization stick

I wrote a simple test program which initializes SDL, prints the SDL
version number, then prints any keydown and keyup events with their
modifiers. (Source code below). Compilation was done using Visual
Studio 6, release mode.

My test sequence was:
Start a command prompt. Type the name of the test program.
shift down
enter down (program starts)
Wait for window to appear
enter up
shift up
spacebar down
spacebar up

Under Windows 98, the output was correct:
SDL 1.2.8
left shift down
shift-return down
shift-return up
left shift up
space down
space up

Under Windows 2000 and under Windows XP, the output was:
SDL 1.2.8
shift-space down
shift-space up

Since shift was not held at the time space was pressed, this is
incorrect. Similar results were observed with launching in different
ways (including double-clicking in Windows Explorer), so it does not
depend on the launching terminal.
2006-01-29 07:57:13 +00:00
Sam Lantinga
8e7e19bb8e *** empty log message *** 2006-01-29 06:40:13 +00:00
Sam Lantinga
b5cd6b001c Re-query the SDL_WINDOWID each time we initialize the video 2006-01-29 06:11:38 +00:00
Sam Lantinga
b0af382e6b *** empty log message *** 2006-01-28 05:47:11 +00:00
Sam Lantinga
32933f19e8 Avoid warnings in Visual C++ 2005 2006-01-27 08:51:27 +00:00
Sam Lantinga
5734de0a4a *** empty log message *** 2006-01-27 08:47:15 +00:00
Sam Lantinga
44d3838ef0 Wacky! :) 2006-01-27 07:02:19 +00:00
Sam Lantinga
b5c719c730 Fixed to match the docs 2006-01-27 06:36:33 +00:00
Sam Lantinga
39ab0b3e3e Date: Mon, 23 Feb 2004 23:29:20 -0500
From: "Brian Kropf"
Subject: [SDL] Windx5

I was wondering if I could suggest a change for (at least) the mingw/msys
build.  Every time I do the ./configure, make on a fresh download it crashes
when it tries to find directx.h for the audio portion of the build

In file included from SDL_dx5audio.c:37:
SDL_dx5audio.h:31:21: directx.h: No such file or directory
In file included from SDL_dx5audio.c:37:

I usually copy the directx.h from the video/windx5 into the audio/windx5 and
things go smoothly after that; just thought I'd suggest it for making future
builds go smoothly. ;)
2006-01-27 05:36:47 +00:00
Sam Lantinga
e2dfdc9cef Who'd have thought that Windows CE wouldn't have the environment APIs? 2006-01-26 08:45:51 +00:00
Sam Lantinga
b71dc0c0cb Compile fix for Window CE 2006-01-26 08:08:22 +00:00
Sam Lantinga
154683b5eb Whoops! (hope this compiles...) 2006-01-26 07:38:43 +00:00
Sam Lantinga
e18aeca150 Updated config* from CVS
http://cvs.savannah.gnu.org/viewcvs/config/?root=config
2006-01-26 07:33:57 +00:00
Sam Lantinga
bfd3ac692d Some explanation on why SDL_RWFromFP doesn't always work on Win32 2006-01-26 06:10:34 +00:00
Sam Lantinga
5d587ee484 Use Win32 API for putenv/getenv to avoid C runtime conflicts 2006-01-26 06:06:56 +00:00
Patrice Mandin
f8f5a513dc Correctly manage mouse relative motion 2006-01-25 20:36:21 +00:00
Patrice Mandin
f9db8339c3 SDL_GetVideoMode, part 3: pixel count compare was failing when only 1 video mode was present 2006-01-25 18:11:56 +00:00
Sam Lantinga
cefbe73b27 Date: Mon, 22 Sep 2003 23:31:54 -0700 (PDT)
From: Rob Neff
Subject: [SDL] testgl.c minor bug fix for fullscreen mode

from:

  if ( strcmp(argv[1], "-fullscreen") == 0 ) {

to:

  if ( strcmp(argv[i], "-fullscreen") == 0 ) {


Minor bug, but might help someone else out who is trying to pass
the command-line params -logo -fullscreen like I was! :)
2006-01-25 07:04:02 +00:00
Sam Lantinga
94ae287dfb Date: Sun, 21 Sep 2003 19:52:42 -0600
From: Tyler Montbriand <tsm@accesscomm.ca>
Subject: Re: [SDL] Hardware buttons on pocket pc

I found it!  :)

It has to do with the UNICODE translation code, in SDL_dibevents.c, in the
'#ifdef NO_GETKEYBOARDSTATE' block in DIB_HandleMessage().  The error
handling is a little...  aggressive.  If it can't translate from unicode, it
wipes out the virtual keycode.
2006-01-25 07:00:40 +00:00
Sam Lantinga
7ce4dacee1 *** empty log message *** 2006-01-25 06:53:50 +00:00
Sam Lantinga
8d3f0fea3b Hopefully the X servers have been fixed (in 5 years) :) 2006-01-25 06:12:57 +00:00
Sam Lantinga
20d0529355 Date: Thu, 04 Sep 2003 02:12:35 +0200
From: Ignacio Casta�o <castanyo@yahoo.es>
Subject: [SDL] SDL_GL_GetAttribute( SDL_GL_MULTISAMPLESAMPLES ...

It would be nice to add the following lines:

case SDL_GL_MULTISAMPLEBUFFERS:
        *value = 0;
break;
case SDL_GL_MULTISAMPLESAMPLES:
        *value = 1;
break;

in wincommon\SDL_wingl.c int the function WIN_GL_GetAttribute at line
484, so that it returns the correct values when arb_pixel_format is not
supported.
2006-01-25 06:04:21 +00:00
Sam Lantinga
a89982e922 Date: 10 Jun 2003 15:30:59 -0400
From: Mike Shal
Subject: [SDL] Bug in SDL_wave.c?

Hey everyone, I'm not sure if this is a bug in SDL, or if I just have
incorrect WAV files.  The problem I'm having is loading multiple
concatenated WAVs from SDL_LoadWAV_RW.  Some WAV files put comments at
the end of the file (which may be bad form), and SDL doesn't skip past
them when reading from the RWops.  So the next WAV I try to load will
start at the comment section of the previous WAV, which obviously
doesn't work.  If anyone else is having this problem, one quick fix you
can do is run sox on the bad WAVs, which strips out all of the comment
sections.
Eg:

$ sox sound.wav tmp.wav
$ mv -f tmp.wav sound.wav

The other fix is to patch SDL_wave.c, which is included with this email.
(Assuming I made the patch correctly :).  All it does is calculate how
much remaining space there is in the WAV file after the data chunk, and
does SDL_RWseek to skip it.  I don't think it should interfere with
anything else, but if someone could check it that would be nice :).  If
the bug is really with SDL and not with my WAVs, can someone work this
into the next version of SDL? Thanks,

-Mike Shal
2006-01-24 07:20:18 +00:00
Sam Lantinga
1cb74d4856 te: Thu, 17 Apr 2003 11:25:26 -0700
From: "Jim"
Subject: [SDL] Frame buffer patches...

Would seem that GCC 3.2.2 promotes all signed values to unsigned if any single vlaue is unsigned in an expression...

for instance when calculating an elo touch position....evertyhign is an (int) except for cach_vinfo.xres which is unsigned.  THerefore if y
ou reverse the SDL_ELO_MIN_X and SDL_ELO_MAX_X values the resulging negative value pegs the expression to it's max.  Attached it the accumu
lated patch to typecast the unsigned values to (int)

- *dx = (cache_vinfo.xres - (cache_vinfo.xres * (input_x - ELO_MIN_X)) / width);

+ *dx = ((int)cache_vinfo.xres - ((int)cache_vinfo.xres * (input_x - ELO_MIN_X)) / width);

and also to provide quite failure to operations which have the screen currently locked...

The touch screen I'm using the original values were exactly opposite of any position I touched on the screen - evaluating the math the expr
ession SHOULD have handled reversing the min and max values - and after casting the unsigned .xres and .yres to a signed int - worked well.
..

Jim
2006-01-24 06:36:43 +00:00
Sam Lantinga
7f458450f5 Date: Thu, 19 Jan 2006 20:02:29 +0200
From: Vassilis Virvilis <vasvir@iit.demokritos.gr>
Subject: [SDL] Request: Please reconsider adding tag in SDL_Event

Hi,

Patch in question:

--- include/SDL_events.h        20 Aug 2004 18:57:01 -0000      1.11
+++ include/SDL_events.h        19 Jan 2006 17:35:09 -0000
@@ -214,7 +214,7 @@
  } SDL_SysWMEvent;

  /* General event structure */
-typedef union {
+typedef union SDL_Event {
         Uint8 type;
         SDL_ActiveEvent active;
         SDL_KeyboardEvent key;

Reasoning:
----------
1) Allows forward declaration of the SDL_Event union in C++. Please
note that in plain C it is possible to forward declare it.

2) Forward declaration is good because it allows encapsulation. It hides
the specific implementation and does not necessarily exposes SDL staff
to my appication's namespace

3) It can't harm plain C because tags are living in a different namespace
than typenames

4) It is already done like this in other places in SDL. Check for example
SDL_KeySym, and SDL_.*Event structures.

5) Right now I have to include SDL/event.h from a C++ header file. See 2)
2006-01-20 13:07:25 +00:00
Patrice Mandin
48dd604274 [PATCH] SDL_GetVideoMode() does not find best mode, part 2
Following commit 1.51, I come accross a problem when SDL must choose between
several video modes that could suit the one asked.

If I ask 320x240 with this list:
768x480 768x240 640x400 640x200 384x480 384x240 320x400 320x200

The smallest selectables modes are 384x240 and 320x400. And SDL choose the later
in this list, but 384x240 is more suitable. So I added a check to compare
the pixel count (surface) of modes, and select the one which has the smallest
pixel count.

In my example, 384x240 has 92160 pixels, and 320x400 has 128000 pixels. So now
SDL will choose 384x240 for the asked 320x240 mode.
2006-01-19 21:28:52 +00:00
Patrice Mandin
51da619080 Rollback 1.28 change, but only for UpdateRects function this time 2006-01-19 18:08:28 +00:00
Sam Lantinga
fd4ded5a50 Fixed MPW include file order 2006-01-19 12:05:14 +00:00
Sam Lantinga
f28f97aeca *** empty log message *** 2006-01-19 10:25:02 +00:00
Sam Lantinga
7a839d1e03 Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
This is a collaborative effort between Alex Volkov and John Popplewell.
Thanks guys!  (Fixes bug #39)
2006-01-19 09:09:32 +00:00
Ryan C. Gordon
e8d968512a Added .cvsignore to the XME directory. 2006-01-19 08:53:12 +00:00
Ryan C. Gordon
64a36c7f71 Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
updated project files, VS2005 support, VGA mode, more device support, etc,
 etc, etc.

Fixes Bugzilla #47 and #28.

--ryan.
2006-01-19 08:43:00 +00:00
Ryan C. Gordon
fac887ab73 Fixed up build script to catch some of the newer files in a "make dist" run. 2006-01-19 08:36:41 +00:00
Sam Lantinga
84b606910a *** empty log message *** 2006-01-19 05:34:24 +00:00
Ryan C. Gordon
b22482454b Catch X11 extension errors...since most of these are notifications that we
queried for a missing extension (such as the XiG vidmode one that most
 people don't have), and default Xlib behaviour is to write notification to
 stderr, this tends to generate incorrect bug reports.

Since we'll actually deal with the missing extension when querying for it,
 we ignore these errors in our hook. The rest continue to pass through to
 the default handler.

Fixes Bugzilla #42.

--ryan.
2006-01-14 08:15:38 +00:00
Ryan C. Gordon
ed8dea650b Don't trample SDL_LoadObject()'s error message in GL loader. 2006-01-13 02:36:35 +00:00
Ryan C. Gordon
f221a8bc28 Make error message meaningful if dlopen() fails on libX11. 2006-01-13 02:32:07 +00:00
Ryan C. Gordon
606daf92a8 Patched to compile with debugging enabled. 2006-01-13 01:30:21 +00:00