SDL.spec.in
author Sam Lantinga <slouken@libsdl.org>
Thu, 02 Apr 2009 04:43:36 +0000
branchSDL-1.2
changeset 4167 a6f635e5eaa6
parent 3929 56ec4d962487
child 3698 17376128fb56
child 12325 c4f2eeda176f
permissions -rw-r--r--
Fixed bug #611

From Tim Angus 2008-08-12 11:18:06

I'm one of the maintainers of ioquake3.org, an updated version of the
Quake 3 engine. Relatively recently, we moved ioq3 to use SDL as a
replacement for 95% of the platform specific code that was there. On the
whole it's doing a great job but unfortunately since the move we've been
getting complaints about the quality of the mouse input on the Windows
platform to the point where for many the game is unplayable. Put in
other terms, the current stable SDL 1.2 is basically not fit for purpose
if you need high quality mouse input as you do in a first person shooter.

Over the weekend I decided to pull my finger out and actually figure out
what's going on. There are basically two major problems. Firstly, when
using the "windib" driver, mouse input is gathered via the WM_MOUSEMOVE
message. Googling for this indicates that often this is known to result
in "spurious" and/or "missing" mouse movement events; this is the
primary cause of the poor mouse input. The second problem is that the
"directx" driver does not work at all in combination with OpenGL meaning
that you can't use DirectInput if your application also uses OpenGL. In
other words you're locked into using the "windib" driver and its poor
mouse input.

In order to address these problems I've done the following:

* Remove WM_MOUSEMOVE based motion event generation and replace with
calls to GetCursorPos which seems much more reliable. In order to
achieve this I've moved mouse motion out into a separate function that
is called once per DIB_PumpEvents.

* Remove the restriction on the "directx" driver being inoperable in
combination with OpenGL. There is a bug for this issues that I've
hijacked to a certain extent
(http://bugzilla.libsdl.org/show_bug.cgi?id=265). I'm the first to admit
I don't really understand why this restriction is there in the first
place. The commit message for the bug fix that introduced this
restriction (r581) isn't very elaborate and I couldn't see any other bug
tracking the issue. If anyone has more information on the bug that was
avoided by r581 it would be helpful as I/someone could then look into
addressing the problem without disabling the "directx" driver.

* I've also removed the restriction on not being allowed to use
DirectInput in windowed mode. I couldn't see any reason for this, at
least not from our perspective. I have my suspicions that it'll be
something like matching up the cursor with the mouse coordinates...

* I bumped up the DirectInput API used to version 7 in order to get
access to mouse buttons 4-7. I've had to inject a little bit of the DX7
headers into SDL there as the MinGW ones aren't up to date in this respect.
     1 Summary: Simple DirectMedia Layer
     2 Name: SDL
     3 Version: @SDL_VERSION@
     4 Release: 1
     5 Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
     6 URL: http://www.libsdl.org/
     7 License: LGPL
     8 Group: System Environment/Libraries
     9 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
    10 Prefix: %{_prefix}
    11 %ifos linux
    12 Provides: libSDL-1.2.so.0
    13 %endif
    14 
    15 %define __defattr %defattr(-,root,root)
    16 %define __soext so
    17 
    18 %description
    19 This is the Simple DirectMedia Layer, a generic API that provides low
    20 level access to audio, keyboard, mouse, and display framebuffer across
    21 multiple platforms.
    22 
    23 %package devel
    24 Summary: Libraries, includes and more to develop SDL applications.
    25 Group: Development/Libraries
    26 Requires: %{name} = %{version}
    27 
    28 %description devel
    29 This is the Simple DirectMedia Layer, a generic API that provides low
    30 level access to audio, keyboard, mouse, and display framebuffer across
    31 multiple platforms.
    32 
    33 This is the libraries, include files and other resources you can use
    34 to develop SDL applications.
    35 
    36 
    37 %prep
    38 %setup -q 
    39 
    40 %build
    41 %ifos linux
    42 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga
    43 %else
    44 %configure
    45 %endif
    46 make
    47 
    48 %install
    49 rm -rf $RPM_BUILD_ROOT
    50 %ifos linux
    51 make install prefix=$RPM_BUILD_ROOT%{prefix} \
    52              bindir=$RPM_BUILD_ROOT%{_bindir} \
    53              libdir=$RPM_BUILD_ROOT%{_libdir} \
    54              includedir=$RPM_BUILD_ROOT%{_includedir} \
    55              datadir=$RPM_BUILD_ROOT%{_datadir} \
    56              mandir=$RPM_BUILD_ROOT%{_mandir}
    57 ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT%{_libdir}/libSDL-1.1.so.0
    58 %else
    59 %makeinstall
    60 %endif
    61 
    62 %clean
    63 rm -rf $RPM_BUILD_ROOT
    64 
    65 %files
    66 %{__defattr}
    67 %doc README-SDL.txt COPYING CREDITS BUGS
    68 %{_libdir}/lib*.%{__soext}.*
    69 
    70 %files devel
    71 %{__defattr}
    72 %doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html
    73 %doc docs/index.html docs/html
    74 %{_bindir}/*-config
    75 %{_libdir}/lib*.a
    76 %{_libdir}/lib*.la
    77 %{_libdir}/lib*.%{__soext}
    78 %dir %{_includedir}/SDL
    79 %{_includedir}/SDL/*.h
    80 %{_libdir}/pkgconfig/sdl.pc
    81 %{_datadir}/aclocal/*
    82 %{_mandir}/man3/*
    83 
    84 %changelog
    85 * Tue May 16 2006 Sam Lantinga <slouken@libsdl.org>
    86 - Removed support for Darwin, due to build problems on ps2linux
    87 
    88 * Mon Jan 03 2004 Anders Bjorklund <afb@algonet.se>
    89 - Added support for Darwin, updated spec file
    90 
    91 * Wed Jan 19 2000 Sam Lantinga <slouken@libsdl.org>
    92 - Re-integrated spec file into SDL distribution
    93 - 'name' and 'version' come from configure 
    94 - Some of the documentation is devel specific
    95 - Removed SMP support from %build - it doesn't work with libtool anyway
    96 
    97 * Tue Jan 18 2000 Hakan Tandogan <hakan@iconsult.com>
    98 - Hacked Mandrake sdl spec to build 1.1
    99 
   100 * Sun Dec 19 1999 John Buswell <johnb@mandrakesoft.com>
   101 - Build Release
   102 
   103 * Sat Dec 18 1999 John Buswell <johnb@mandrakesoft.com>
   104 - Add symlink for libSDL-1.0.so.0 required by sdlbomber
   105 - Added docs
   106 
   107 * Thu Dec 09 1999 Lenny Cartier <lenny@mandrakesoft.com>
   108 - v 1.0.0
   109 
   110 * Mon Nov  1 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
   111 - First spec file for Mandrake distribution.
   112 
   113 # end of file