1. 29 Jan, 2006 8 commits
    • Sam Lantinga's avatar
      Date: Tue, 15 Feb 2005 21:28:48 +0900 (JST) · 31d40ce8
      Sam Lantinga authored
      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
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401290
      31d40ce8
    • Sam Lantinga's avatar
      Use the executable directory, not the current directory, for stdio output files · 16857d62
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401289
      16857d62
    • Sam Lantinga's avatar
      *** empty log message *** · baaae734
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401288
      baaae734
    • Sam Lantinga's avatar
      Report both absolute and relative motion · dd2c4cfc
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401287
      dd2c4cfc
    • Sam Lantinga's avatar
      Date: Fri, 14 Jan 2005 21:52:46 +0100 · c6c791fe
      Sam Lantinga authored
      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.
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401286
      c6c791fe
    • Sam Lantinga's avatar
      Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC) · ee646e66
      Sam Lantinga authored
      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.
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401285
      ee646e66
    • Sam Lantinga's avatar
      *** empty log message *** · c7602580
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401284
      c7602580
    • Sam Lantinga's avatar
      Re-query the SDL_WINDOWID each time we initialize the video · 82eea8b8
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401283
      82eea8b8
  2. 28 Jan, 2006 1 commit
  3. 27 Jan, 2006 5 commits
    • Sam Lantinga's avatar
      Avoid warnings in Visual C++ 2005 · 3441f3ea
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401281
      3441f3ea
    • Sam Lantinga's avatar
      *** empty log message *** · dd364f45
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401280
      dd364f45
    • Sam Lantinga's avatar
      Wacky! :) · 4d80aa48
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401279
      4d80aa48
    • Sam Lantinga's avatar
      Fixed to match the docs · 33f5989f
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401278
      33f5989f
    • Sam Lantinga's avatar
      Date: Mon, 23 Feb 2004 23:29:20 -0500 · 8cf42f6c
      Sam Lantinga authored
      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. ;)
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401277
      8cf42f6c
  4. 26 Jan, 2006 6 commits
  5. 25 Jan, 2006 7 commits
    • Patrice Mandin's avatar
      Correctly manage mouse relative motion · 0a8520eb
      Patrice Mandin authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401270
      0a8520eb
    • Patrice Mandin's avatar
      SDL_GetVideoMode, part 3: pixel count compare was failing when only 1 video mode was present · 7109c9a2
      Patrice Mandin authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401269
      7109c9a2
    • Sam Lantinga's avatar
      Date: Mon, 22 Sep 2003 23:31:54 -0700 (PDT) · ca8ee26f
      Sam Lantinga authored
      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! :)
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401268
      ca8ee26f
    • Sam Lantinga's avatar
      Date: Sun, 21 Sep 2003 19:52:42 -0600 · 866ce3c3
      Sam Lantinga authored
      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.
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401267
      866ce3c3
    • Sam Lantinga's avatar
      *** empty log message *** · fbc7623f
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401266
      fbc7623f
    • Sam Lantinga's avatar
      Hopefully the X servers have been fixed (in 5 years) :) · 3fb93793
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401265
      3fb93793
    • Sam Lantinga's avatar
      Date: Thu, 04 Sep 2003 02:12:35 +0200 · 3cc77ac9
      Sam Lantinga authored
      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.
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401264
      3cc77ac9
  6. 24 Jan, 2006 2 commits
    • Sam Lantinga's avatar
      Date: 10 Jun 2003 15:30:59 -0400 · 3506c143
      Sam Lantinga authored
      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
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401263
      3506c143
    • Sam Lantinga's avatar
      te: Thu, 17 Apr 2003 11:25:26 -0700 · e0fbb3b5
      Sam Lantinga authored
      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
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401262
      e0fbb3b5
  7. 20 Jan, 2006 1 commit
    • Sam Lantinga's avatar
      Date: Thu, 19 Jan 2006 20:02:29 +0200 · ba553ad7
      Sam Lantinga authored
      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)
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401261
      ba553ad7
  8. 19 Jan, 2006 9 commits
  9. 14 Jan, 2006 1 commit
    • Ryan C. Gordon's avatar
      Catch X11 extension errors...since most of these are notifications that we · 37f69928
      Ryan C. Gordon authored
       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.
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401251
      37f69928