Coder Social home page Coder Social logo

libsdl-org / sdl-1.2 Goto Github PK

View Code? Open in Web Editor NEW
84.0 11.0 72.0 17.48 MB

Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!

Home Page: https://libsdl.org

License: GNU Lesser General Public License v2.1

HTML 0.50% Makefile 0.20% C 82.54% Shell 4.02% Rich Text Format 0.18% C++ 5.47% Objective-C 3.59% M4 2.07% Assembly 1.29% Logos 0.05% Perl 0.01% Batchfile 0.01% Rez 0.08%
sdl

sdl-1.2's Introduction

DEPRECATED

The 1.2 branch of SDL is deprecated. While we occasionally collect fixes in revision control, there has not been a formal release since 2012, and we have no intention to do future releases, either.

Current development is happening in SDL 2.0.x, which gets regular releases and can be found at:

https://github.com/libsdl-org/SDL

Thanks!

Simple DirectMedia Layer (SDL) Version 1.2

https://www.libsdl.org/

This is the Simple DirectMedia Layer, a general API that provides low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D framebuffer across multiple platforms.

The current version supports Linux, Windows CE/95/98/ME/XP/Vista, BeOS, MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64, RISC OS, SymbianOS, Nintendo DS, and OS/2, but these are not officially supported.

SDL is written in C, but works with C++ natively, and has bindings to several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, Pike, Pliant, Python, Ruby, and Smalltalk.

This library is distributed under GNU LGPL version 2, which can be found in the file "COPYING". This license allows you to use SDL freely in commercial programs as long as you link with the dynamic library.

The best way to learn how to use SDL is to check out the header files in the "include" subdirectory and the programs in the "test" subdirectory. The header files and test programs are well commented and always up to date. More documentation is available in HTML format in "docs/index.html".

The test programs in the "test" subdirectory are in the public domain.

Enjoy!

Sam Lantinga ([email protected])

sdl-1.2's People

Contributors

1bsyl avatar 3v1n0 avatar barracuda156 avatar bavison avatar carlo-bramini avatar ccawley2011 avatar danielgibson avatar de4me avatar dos1 avatar ferzkopp avatar icculus avatar medourmehdi avatar mikrosk avatar orbea avatar pcercuei avatar phlamethrower avatar pionere avatar pmandin avatar ppisar avatar sezero avatar slime73 avatar slouken avatar smcv avatar sulix avatar th-otto avatar vinriviere avatar winterheart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdl-1.2's Issues

X11 build failure on MacOS X

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Mac OS X (All), PowerPC

Comments on the original bug report:

On 2006-02-02 01:44:36 +0000, Sam Lantinga wrote:

configure reports:
checking for Cocoa framework... yes
checking for X... no
checking for OpenGL (GLX) support... no
checking for pthreads... yes
checking for recursive mutexes... no
checking for pthread semaphores... yes
...

Then building the library fails:
In file included from SDL_QuartzVideo.h:63,
from SDL_QuartzEvents.m:23:
../../../include/SDL_syswm.h:58:22: X11/Xlib.h: No such file or directory
../../../include/SDL_syswm.h:59:23: X11/Xatom.h: No such file or directory
In file included from SDL_QuartzVideo.h:63,
from SDL_QuartzEvents.m:23:
../../../include/SDL_syswm.h:76: error: parse error before "XEvent"
../../../include/SDL_syswm.h:76: warning: no semicolon at end of struct or union
../../../include/SDL_syswm.h:76: warning: no semicolon at end of struct or union
../../../include/SDL_syswm.h:77: warning: type defaults to int' in declaration of event'
etc.

On 2006-02-02 01:46:06 +0000, Sam Lantinga wrote:

We can't really default on anything in SDL_syswm.h that may not exist on a platform. This header is included by the application code and needs to work wherever the library is installed.

On 2006-02-02 02:06:03 +0000, Ryan C. Gordon wrote:

Huh, I get this:

checking for Cocoa framework... yes
checking for X... libraries /usr/X11R6/lib, headers

I always assumed this was just part of the Mac OS SDK, but it probably relies on installing the X11 package, which is unchecked by default in the OS (not developer tools!) install. Hmm.

--ryan.

On 2006-03-09 10:21:00 +0000, Sam Lantinga wrote:

SDL_config.h takes care of this now. :)

libgpm support

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, All

Comments on the original bug report:

On 2006-01-21 15:02:09 +0000, Patrice Mandin wrote:

It was quite easy to add gpm support to SDL, however, it is not working,
and I don't know where the problem comes from.

I never get any mouse events: mouse_fd descriptor has bytes to read (in
FB_PumpEvents() function), but the FD_ISSET test always fails. So maybe
I miss something about gpm usage. When I compare to the gpm mev.c test
program, everything seems to be there and ok.

So I post the current patch (in message in URL), for anyone else to have a look. Note: I removed the current (broken) gpm support with my patch, and you must set
SDL_MOUSEDRV to gpm to use the libgpm driver.

On 2006-01-27 11:23:18 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-22 01:46:58 +0000, Sam Lantinga wrote:

FYI, as far as I can tell, libgpm isn't under the LGPL yet:
http://lists.linux.it/pipermail/gpm/2005-September/000853.html

Moin!

Enrico Weigelt [Thu, Sep 08, 2005 at 07:13:10PM +0200]:

[libgpm as LGPL]

Sounds good.

Please be patient for next release, I'll change the license for
libgpm.

The current status:

  • I moved to Switzerland
  • I wrote an init system, which should have a new release soon [0]
  • After that release I'll stop all other projects and concentrate
    on a gpm release
  • Patches sent to me or the list are archived, mostly not reviewed yet
  • monotone (VCS) will be updated soon to a new version

Good night,

Nico

On 2007-07-05 22:45:31 +0000, Sam Lantinga wrote:

So the main author of libgpm is okay with it:
http://lists.linux.it/pipermail/gpm/2005-September/000863.html

Please be patient for next release, I'll change the license for
libgpm.

As already noted, you can't do that. I would have switched GNU barcode
to LGPL if it wasn't so difficult.

For libgpm, you have my approval. I think I'm still the main author.
You have to track others, though.

/alessandro

=========================================

However, it looks like gpm itself is languishing:

I am somehow happy to announce a broken release, gpm-1.20.2-broken.

The archive can be found on http://unix.schottelius.org/gpm/,
the detailled reasons for this broken release can be found in
http://unix.schottelius.org/gpm/browse_source/gpm-1.20.2-broken/doc/README.1.20.2.

Fixing of the compilation errors may happen in the near future.

Sincerly

Nico

=========================================

So... I'm going to shelve this for now. :)

src/loadso dirs need Makefile.am ...

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2006-01-12 17:43:40 +0000, Ryan C. Gordon wrote:

...or they won't show up in the package in a "make dist" run.

--ryan.

On 2006-01-27 11:23:14 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-02-09 13:01:43 +0000, Ryan C. Gordon wrote:

Sam, I'm tossing this bug to you because you're doing source tree reorganization.

--ryan.

On 2006-03-09 10:11:58 +0000, Sam Lantinga wrote:

Makefile.am is obsolete. :)

Are X11 extension checks in configure.in necessary?

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-30 12:10:17 +0000, Ryan C. Gordon wrote:

We have a bunch of AC_TRY_COMPILE checks in the configure script for things like --enable-video-x11-vm ... these are now dynamically loaded, so we fail gracefully at runtime if the libraries aren't installed, and we include the extension code and headers in SDL, so we don't need to check if the build system has these extensions, either. Should we just remove these blocks from configure.in? Should we just remove the compile checks, leaving this as a switch to explicitly disable the support at build time?

--ryan.

On 2006-01-31 09:11:50 +0000, Sam Lantinga wrote:

(In reply to comment # 0)

We have a bunch of AC_TRY_COMPILE checks in the configure script for things
like --enable-video-x11-vm ... these are now dynamically loaded, so we fail
gracefully at runtime if the libraries aren't installed, and we include the
extension code and headers in SDL, so we don't need to check if the build
system has these extensions, either. Should we just remove these blocks from
configure.in? Should we just remove the compile checks, leaving this as a
switch to explicitly disable the support at build time?

Sure, that sounds fine.

Inform applications about OpenGL context recreation

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2006-01-10 17:10:05 +0000, Patrice Mandin wrote:

Not all OpenGL implementations used by SDL destroy and recreate the OpenGL context when SDL_SetVideoMode() is called, or when the application window is resized.

My proposal was to add two things in SDL:

  • Set a bit in SDL_Surface screen flag that tells that the OpenGL context has been kept (leave it to zero if context has been destroyed, so all current applications still don't care about it).
  • Add a new event to tell that the OpenGL context has been destroyed and recreated. This is when the window is resized, because the application does not call SDL_SetVideoMode() in this case.

Currently some applications has some #ifdef WIN32 part of code to force reloading everything related to the OpenGL context (textures, display lists, etc...) when either SDL_SetVideoMode() is called or the application window is resized. This topic is platform-dependent, so it should be hidden inside SDL.

The topic comes back once in a while, see an older one:
http://www.devolution.com/pipermail/sdl/2004-November/065847.html

On 2006-01-27 11:23:13 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-02-07 16:58:11 +0000, Patrice Mandin wrote:

Created attachment 70
Definition of a flag for screen surface, and example setting it for x11 driver

OK, here is the small patch. I add a new flag for the SDL_Surface screen
flag. The flag is cleared before calling any _SetVideoMode. Then
it is the responsibility of the driver to set the flag if the OpenGL
context has been kept (not destroyed). I added the small patch for the
x11 driver. Then, the application can check this bit to see if the
OpenGL context has been destroyed or not. So now we can have:

  • Old applications with new SDL: Don't care about the bit
  • New applications with old SDL: Always see the bit as zero, so behave
    the same.
  • New applications with new SDL: What we intended.

Both windib and windx5 always destroy the context, I don't know about
other video drivers. At least, for my part (using OSMesa on Atari),
simply resizing the context does not destroy it, so I will do this part
myself.

Also, it seems there is no need for a special event, as SDL_VIDEORESIZE
only tell about the new size, and the application must call
SDL_SetVideoMode().

Of course, any comments are welcomed.

On 2006-02-07 20:42:03 +0000, Ryan C. Gordon wrote:

My only concern is that it's possible to lose hardware surfaces on Windows completely outside the control of your application...are we SURE there's no time other than SetVideoMode where the GL context can be lost?

--ryan.

On 2006-02-08 12:28:01 +0000, Sam Lantinga wrote:

(In reply to comment # 3)

My only concern is that it's possible to lose hardware surfaces on Windows
completely outside the control of your application...are we SURE there's no
time other than SetVideoMode where the GL context can be lost?

I believe that's the case, and even when the window is resized it isn't lost, it's only when the fullscreen video mode changes, which is under the application's control.

I'd like to hold off on this patch, in the hope that we can have different code paths for window resizing and setting new video modes in SDL 1.3. Currently everyone always re-creates their OpenGL state when they call SDL_SetVideoMode(), which is the safe thing to do.

On 2006-02-16 11:16:21 +0000, Gerry JJ wrote:

(In reply to comment # 4)

I believe that's the case, and even when the window is resized it isn't lost,
it's only when the fullscreen video mode changes, which is under the
application's control.

What happens if the SDL app runs in a window while a different app switches the fullscreen video mode ?

On 2011-12-30 00:29:46 +0000, Ryan C. Gordon wrote:

I'm going to close this as WONTFIX for 1.2, since the 1.3 API handles this properly, and I don't think we should make changes like this to 1.2 at this point.

--ryan.

On 2015-08-25 09:38:22 +0000, Ryan C. Gordon wrote:

Hello, and sorry if you're getting several copies of this message by email, since we are closing many bugs at once here.

We have decided to mark all SDL 1.2-related bugs as RESOLVED ENDOFLIFE, as we don't intend to work on SDL 1.2 any further, but didn't want to mark a large quantity of bugs as RESOLVED WONTFIX, to clearly show what was left unattended to and make it easily searchable.

Our current focus is on SDL 2.0.

If you are still having problems with an ENDOFLIFE bug, your absolute best option is to move your program to SDL2, as it will likely fix the problem by default, and give you access to modern platforms and tons of super-cool new features.

Failing that, we will accept small patches to fix these issues, and put them in revision control, although we do not intend to do any further official 1.2 releases.

Failing that, please feel free to contact me directly by email ([email protected]) and we'll try to find some way to help you out of your situation.

Thank you,
--ryan.

WinCE GAPI video driver

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Windows (CE)/PocketPC, Other

Comments on the original bug report:

On 2006-01-18 09:38:00 +0000, Dmitry Yakimov wrote:

GAPI driver supports:

  • all possible WinCE devices (Pocket PC, Smartphones, HPC)
    with different orientations of video memory and resolutions.
  • 4, 8 and 16 bpp devices
  • special handling of 8bpp on 8bpp devices
  • VGA mode, you can even switch between VGA and GAPI in runtime
    (between 240x320 and 480x640 for example). On VGA devices you can
    use either GAPI or VGA.
  • Landscape mode and automatic rotation of buttons and stylus coordinates.
    To enable landscape mode make width of video screen bigger than height.
    For example:
    SDL_SetVideoMode(320,240,16,SDL_FULLSCREEN)
  • WM2005
  • SDL_ListModes

It contains updated project files for bug # 28 (wince timer patch)

On 2006-01-18 09:39:34 +0000, Dmitry Yakimov wrote:

Created attachment 24
It contains diff, binary libraries for testing and updated project files

On 2006-01-19 03:06:00 +0000, Ryan C. Gordon wrote:

I'm taking a look at this now...

--ryan.

On 2006-01-19 03:43:31 +0000, Ryan C. Gordon wrote:

This is now in CVS...thanks for all the work on this!

--ryan.

On 2006-01-22 03:43:24 +0000, Ryan C. Gordon wrote:

*** Bug 65 has been marked as a duplicate of this bug. ***

On 2006-01-27 11:23:15 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

zip up OS/2 project files...

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: OS/2, x86

Comments on the original bug report:

On 2006-01-21 14:18:28 +0000, Ryan C. Gordon wrote:

"Ryan, can you zip (or something) the OS2 project files? I've tried
to keep the project files for each port in their own archive, just
to keep the directory structure sane(ish)

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment"

On 2006-01-27 11:23:18 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-02-26 14:31:19 +0000, Sam Lantinga wrote:

This is taken care of in CVS, thanks to Doodle. :)

problems with SDL_BlitSurface from PNG to transparent surface

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 1.2.9
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-23 04:32:53 +0000, Davide Coppola wrote:

I have tried to blit a PNG with an alpha channel on a transparent surface created using format data from the image, the result of SDL_BlitSurface() is just nothing!

I have solved my problem using memcpy() if the image has the same dimension of the surface and using getpixel()/putpixel() if the image is smaller than the surface (or if I need a partial blit).

this source shows the problem:
http://mars.sourceforge.net/SDL/trans_bug/trans_test1.c
this are my solutions:
http://mars.sourceforge.net/SDL/trans_bug/trans_test2.c
and this is the package with all the sources and data:
http://mars.sourceforge.net/SDL/trans_bug.tar.gz

I hope this could help you.

On 2006-01-27 11:23:21 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-20 02:40:09 +0000, Sam Lantinga wrote:

This is not technically a bug.

According to the documentation:

  • RGBA->RGBA:
  • SDL_SRCALPHA set:
    
  •  alpha-blend (using the source alpha channel) the RGB values;
    
  •  leave destination alpha untouched. [Note: is this correct?]
    
  •  SDL_SRCCOLORKEY ignored.
    
  • SDL_SRCALPHA not set:
    
  •  copy all of RGBA to the destination.
    

SDL_DisplayFormatAlpha() turns on SDL_SRCALPHA by default (to enable blending)

What I did to fix this in your test program was just add SDL_SetAlpha(img, 0, 0) before the blit onto window. Of course a manual memcpy works just as well. :)

Thanks for the great test case!

On 2006-03-20 04:20:11 +0000, Davide Coppola wrote:

(In reply to comment # 2)

I confirm that your solution works well, and I'm glad of this ;)

Just a note for someone interested:
if you want to blit img on screen after you have set SDL_SetAlpha(img, 0, 0), you have to set SDL_SetAlpha(img, SDL_SRCALPHA, 0).

Best regards.

CodeWarrior projects updated

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Mac OS Classic, PowerPC

Comments on the original bug report:

On 2006-01-19 07:39:26 +0000, Sam Lantinga wrote:

ate: Wed, 14 Sep 2005 23:22:24 +0200
From: Anders_F_Bj&# 65533;klund [email protected]
Subject: [SDL] CodeWarrior projects updated

I've updated the CodeWarrior projects to
build the latest SDL version (from CVS)

Both the old CW5 project, as well as an
updated version for CW6 (Classic/Carbon)

I also found some problems with the old
projects, except for missing files etc:

  • both the debug/static and release/dynamic
    library was using the name "SDL.X86.LIB" ?
  • CW5 couldn't build for Carbon correctly
    (a known problem, but I removed the targets)
  • CW6 didn't really want to use the old StdCLib
    (so I just linked against MSL for the "new")

The OpenGL used was an old version, so I
just deleted that and built against 1.2.
(with a path of "{CodeWarrior}:OpenGL")
It can be downloaded from Apple's FTP:
ftp://ftp.apple.com/developer/opengl/SDK/

Also did some minor changes in naming:

  • renamed "SDL.PPC.DLL" to SDLClassic
  • renamed "Carbon" suffix to just CRB
  • changed SDL.X86.LIB to just SDL.LIB
  • changed SDL.X86.DLL to just SDL.DLL

Here is a portrait of all of the family together:
http://www.algonet.se/~afb/libsdl/SDL-cw.png

"SDL" is the old Mac-library that is even MPW-compatible,
SDLClassic is for InterfaceLib and SDLCarbon for CarbonLib

You can only have one of them "active", or you'll get errors
like these: http://www.algonet.se/~afb/libsdl/linkerrors.html

Tested with Mac OS X, Mac OS 9 (Classic), Windows 98 (VPC)
and seems to be working just fine - including the GL demo.

Here are the exported XML project files, from CodeWarrior:
http://www.algonet.se/~afb/libsdl/CWprojects-xml.zip

It also includes a few new/updated Mac support files.
I'll make a binary version of "CWProjects.sea" later.

--anders

PS. Yes, it's all obsolete... Still works fine, though ?
For the real builds, I'm using Xcode. (GNU Make too)

On 2006-01-27 11:23:17 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-02-25 14:00:17 +0000, Sam Lantinga wrote:

*** Bug 14 has been marked as a duplicate of this bug. ***

On 2006-03-26 05:51:05 +0000, Anders F Bj wrote:

OK, I will try to update the old projects but there are some additions in the new SDL that are not compatible with the old Mac builds such as the "../*" includes.

So it's possible that there won't be projects for Classic or Win32, just a Carbon project (for Mac OS 9 / Mac OS X CFM) Adding a Mach-O project to CW could be done.

What kind of backwards compatibility is SDL looking at ?
(I guess the MPW and Xcode projects are outside this bug)

On 2006-03-26 06:11:54 +0000, Anders F Bj wrote:

Removing these files:
audio/SDL_audiomem.c
endian/SDL_endian.c
SDL_getenv.c
SDL_loadso.c

Adding these files:
stdlib/SDL_getenv.c
loadso/macos/SDL_sysloadso.c

Probably some others, before it builds.

Also need to change SDL_opengl.h:

#if defined(MACOSX)
#include <OpenGL/gl.h> /* Header File For The OpenGL Library /
#include <OpenGL/glu.h> /
Header File For The GLU Library /
#elif defined(MACOS)
#include <gl.h> /
Header File For The OpenGL Library /
#include <glu.h> /
Header File For The GLU Library /
#else
#include <GL/gl.h> /
Header File For The OpenGL Library /
#include <GL/glu.h> /
Header File For The GLU Library */
#endif

Can't activate UNIX paths otherwise,
as it doesn't find the GL headers ?

On 2006-03-26 08:19:26 +0000, Anders F Bj wrote:

Here are the available targets, for each version:

CW5:

  • MacOS (PPC)
  • Win32 (X86)

CW6:

  • Classic (MacOS)
  • Carbon
  • Win32

CW9:

  • CFM (Carbon)
  • Mach-O
  • Win32

The Mach-O project currently doesn't build,
since the platform headers don't work for it.
("SDL_platform.h" thinks that it is Classic,
seems to only recognize Apple's GCC compilers)

On 2006-03-26 08:20:32 +0000, Anders F Bj wrote:

OpenGL headers added as Bug 183

On 2006-04-13 23:41:26 +0000, Sam Lantinga wrote:

Can you attach the updated projects? The ones at http://www.algonet.se/~afb/libsdl/CWprojects-xml.zip appear to be old.

Thanks!

On 2006-05-04 08:47:01 +0000, Anders F Bj wrote:

Will do...

On 2006-05-07 17:09:29 +0000, Sam Lantinga wrote:

I'd like to get this fixed for SDL 1.2.10 release, if possible.

On 2006-05-09 09:48:02 +0000, Anders F Bj wrote:

Created attachment 116
CWprojects-xml.zip

XML-exported projects for CodeWarrior 5 and 6
Rez-exported resource files, for CodeWarrior

On 2006-05-09 09:50:58 +0000, Anders F Bj wrote:

Uploaded oldskool projects for Classic and for Carbon/CFM,
CW9 project for Mach-O/Carbon.framework not working 100%

Trying to submit the necessary code changes separately,
for compiling with Carbon/CFM and Win32 with CodeWarrior.

On 2006-05-09 18:36:47 +0000, Anders F Bj wrote:

Created attachment 121
CWprojects-cw9.zip

On 2006-05-09 18:40:33 +0000, Anders F Bj wrote:

There will be no Win32 targets for CW9/CW10.
Instead, the following targets were added:

CW9:

  • CFM (Carbon)
  • Carbon (Mach-O)
  • Cocoa (Mach-O)

It builds the following Mach-O:

  • SDLmainCarbon.lib
  • SDLCarbon.dylib
  • SDLmainCocoa.lib
  • SDLCocoa.dylib
    All linking to libSystem.dylib

On 2006-05-10 03:34:56 +0000, Anders F Bj wrote:

Seems like all the changes are in Subversion now,
so it's soon time for the big "smoke test" of it...

Time for another "family portrait", with the new members
"Carbon Mach-O" and "Cocoa Mach-O" in addition to the old

Maybe I'll take a peek at the MPW and ProjectBuilder
too, but I'm not sure if it's worth any effort or not?
(that was: the old Mac OS X .pbproj and .xcode projects,
and the Makefiles for build Mac OS 9 libraries with MPW)

On 2006-05-10 03:37:56 +0000, Sam Lantinga wrote:

(In reply to comment # 14)

Seems like all the changes are in Subversion now,
so it's soon time for the big "smoke test" of it...

Time for another "family portrait", with the new members
"Carbon Mach-O" and "Cocoa Mach-O" in addition to the old

Great. :)
Go ahead and attach any new projects, and obsolete the old attachments.
Thanks!

Maybe I'll take a peek at the MPW and ProjectBuilder
too, but I'm not sure if it's worth any effort or not?
(that was: the old Mac OS X .pbproj and .xcode projects,
and the Makefiles for build Mac OS 9 libraries with MPW)

The MPW Makefiles are all up to date. The Xcode projects are up to date, and build Universal binaries and redistributable packages. The Project Builder files are gone for good.

On 2006-05-10 03:44:11 +0000, Anders F Bj wrote:

(In reply to comment # 15)

The MPW Makefiles are all up to date. The Xcode projects are up to date, and
build Universal binaries and redistributable packages. The Project Builder
files are gone for good.

I meant the Xcode 1.5 projects, which also seem "gone for good".
In the tarball there was only Xcode 2 projects for Mac OS X 10.4

All this project file version craziness is a good reason (for me)
to leave both CodeWarrior and Xcode behind and just use MPW/Make.

On 2006-05-11 04:33:53 +0000, Sam Lantinga wrote:

Thanks! I've updated CWprojects.sea.bin with the CodeWarrior 5 and 6 projects.

In addition, I did the following for the CodeWarrior 5 projects:

  • Updated the version string to 1.2.10
  • Removed Win32 targets from CodeWarrior 5 projects (since I don't have Win32 compiler support)
  • Cleaned up access paths
  • Removed unnecessary macos_prefix.h
  • Added all necessary StdCLib headers to Support:MacOS
  • Added OpenGL 1.2 API headers and libraries to Support:MacOS
  • Added testdyngl test program
  • Removed OpenGL stub from all test programs except for testgl

On 2006-05-11 04:40:04 +0000, Anders F Bj wrote:

(In reply to comment # 17)

In addition, I did the following for the CodeWarrior 5 projects:

Keeping busy! :-)

The Win32 target did require some patching of the SDL sources,
so there's a big patch needed in order for that to work anyway...
I tested the earlier Win CW builds with Windows 98 (in VPC :-) ),
but haven't gotten around to doing so with these new SDL 1.2.10

switching between fullscreen and windowed mode, 16 bits opengl, fails

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.9
Reported for operating system, platform: Windows (XP), x86

Comments on the original bug report:

On 2006-01-22 18:21:29 +0000, Gregory Smith wrote:

I get an "Unable to make GL context current" error when switching between fullscreen and windowed modes, but only at 16 bit depth--15 and 32 work fine. This happens with DirectX and windib drivers.

There's an example in the URL above.

On 2006-01-22 18:23:31 +0000, Gregory Smith wrote:

Created attachment 28
example code

Ah, now I can post an attachment

On 2006-01-27 11:23:20 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-14 02:41:51 +0000, Sam Lantinga wrote:

In this case we have to recreate the OpenGL window, and there was code to do this in SDL, but it was disabled because it doesn't work with DirectX.

I've re-enabled this code for the windib driver, which is the default now.

NetBSD patch evaluation

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: NetBSD, x86

Comments on the original bug report:

On 2006-01-19 05:17:21 +0000, Sam Lantinga wrote:

We should look at the NetBSD patches and see if there are any worth adding to CVS.

On 2006-01-19 05:27:45 +0000, Ryan C. Gordon wrote:

I'll add the patches to Bugzilla soon, with a brief summary of them ("patch-aa", "patch-ab", etc isn't too descriptive).

Most look sane...many add #ifdef DragonFly to places that check for BSD systems and are simple enough, others chew up configure.in quite a bit and need to be checked more closely.

However, they have split out the esound, arts, etc SDL audio drivers into seperate "plug-in" modules that are seperately packaged and dynamically loaded at runtime if they exist. This might be a leftover from before we added dynamic loading of libesd, etc into SDL itself...we should follow up with the NetBSD maintainers and see if we can get them to move to this and ditch the seperate packages.

--ryan.

On 2006-01-19 05:33:21 +0000, Sam Lantinga wrote:

(In reply to comment # 1)

I'll add the patches to Bugzilla soon, with a brief summary of them
("patch-aa", "patch-ab", etc isn't too descriptive).

Great!

However, they have split out the esound, arts, etc SDL audio drivers into
seperate "plug-in" modules that are seperately packaged and dynamically loaded
at runtime if they exist. This might be a leftover from before we added dynamic
loading of libesd, etc into SDL itself...we should follow up with the NetBSD
maintainers and see if we can get them to move to this and ditch the seperate
packages.

I agree. Do we have a maintainer contact?

On 2006-01-19 05:34:48 +0000, Ryan C. Gordon wrote:

Do we have a maintainer contact?

I don't, but I'm sure we can find one.

--ryan.

On 2006-01-27 11:23:17 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-20 23:39:22 +0000, Ryan C. Gordon wrote:

Ok, I sorted through these patches more thoroughly, and there's a handful of good patches...the DragonFly stuff refers to DragonFly BSD, which is a fork of FreeBSD 4...some of those patches would break existing FreeBSD code, or should at least be cleaned up so we don't have to check for DRAGONFLY || FREEBSD everywhere.

Also, it means that NetBSD probably lifted the patches wholesale from DragonFly, so that is another group/person we should contact.

A good portion of their patches were automake stuff that is either no longer valid, or non-trivial to reintegrate without a better understanding of why the changes are needed.

I'm committing the easy bits to CVS, and will track down the developers for integrating the rest...they'll need to do some heavy lifting to get some of these patches to match up to CVS again with the new build system, so they might as well do it once and have it go right into CVS from there.

--ryan.

On 2006-03-20 23:44:02 +0000, Sam Lantinga wrote:

Hold on, I have a dragonfly install now, I'm in the process of testing the patches. :)

On 2006-03-21 00:14:34 +0000, Ryan C. Gordon wrote:

Created attachment 86
Initial salvage...

Here's my cleaned-up patch for some good patches salvaged from the NetBSD package, against CVS.

I intentionally avoided all the Dragonfly stuff for now. This is just the non-controversial stuff.

--ryan.

On 2006-03-21 00:15:38 +0000, Ryan C. Gordon wrote:

(Whoops, didn't realize this was assigned to Sam, changing status back to "new" until he accepts it or tosses it to me.)

--ryan.

On 2006-03-21 03:57:48 +0000, Sam Lantinga wrote:

Most of the patches have been merged.

The dynamic nas, esd, and arts patches were not applied, since SDL already dynamically loads the esd and arts libraries at runtime, if available. Hopefully the nas driver can be converted over to a similar mechanism.

On 2006-03-21 04:33:52 +0000, Sam Lantinga wrote:

Good idea, renaming OpenBSD audio to BSD audio. I've applied that portion of your patch to CVS.

YUV to RGB MMX conversion code broken

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-31 21:32:05 +0000, wrote:

It looks like the mmx conversion code from SDL12/src/video/SDL_yuv_mmx.c is broken, at least when converting to 16bpp.

Here is the beggining of the relevant thread :
http://www.devolution.com/pipermail/sdl/2005-April/068444.html

On 2006-02-21 15:02:41 +0000, Sam Lantinga wrote:

ld: build/.libs/SDL_yuv_mmx.o has local relocation entries in
non-writable section (__TEXT,__text)
/usr/bin/libtool: internal link edit command failed

That was when linking the shared library. I think previously we just
disabled this MMX code on the Intel Mac, so it's probably not a build
system-specific issue, but I'm not sure.

Oh, this is beautiful. Here's how to access those static tables in
assembly on Intel Mac:
call ___i686.get_pc_thunk.bx
"L00000000001$pb":
leal _MMX_0080w-"L00000000001$pb"(%ebx), %eax

ugh, and here's the same code for i686 Linux:
call .L2
.L2:
popl %ebx
addl $GLOBAL_OFFSET_TABLE+[.-.L2], %ebx
movl _MMX_0080w@GOTOFF(%ebx), %eax
movl %eax, -8(%ebp)
subl $8, %esp
pushl -8(%ebp)
leal .LC0@GOTOFF(%ebx), %eax

Nice, eh?

I'm guessing that this code just doesn't work at all for relocated
objects. In fact, I seem to remember a bug about it... Yep...
https://bugzilla.libsdl.org/show_bug.cgi?id=127

Doh. We can't pass any more parameters to the assembly, right?

Oh, here's a nice tidbit from the comments in the file:
/* We don't really care about PIC - the code should be rewritten to use
relative addressing for the static tables, so right now we take the
COW hit on the pages this code resides. Big deal.
*/
Hah.

On 2006-02-21 16:44:35 +0000, Sam Lantinga wrote:

We could convert this file to nasm, which will support Mac Intel soon.
We'd need to convert the static data references into relocatable data references though, as described here:
http://nasm.sourceforge.net/doc/html/nasmdoc8.html#section-8.2

We could also let gcc construct the data on the stack, and reference it there instead...

In the meantime, I'm disabling the code until we get it rewritten.

On 2006-02-21 17:07:22 +0000, wrote:

nasm is definitely not the right thing to do :

  • we can't use it to do asm code that works on both 32 and 64 bits targets, while that's possible with gas.
  • it requires an external tool and therefore is less portable than gas
  • it adds even more linking tricks

Actually, the trouble with this file, which makes it necessary to use this strange parameter naming stuff is that old (2.95) gcc versions do not support enough asm parameters (10). Maybe it's time to drop gcc 2.95 support ?

Alternatively, I think we could make those consts into an array, and hardcode the array offsets so that they end up as one asm parameter.

On 2006-02-21 17:21:40 +0000, Sam Lantinga wrote:

(In reply to comment # 3)

Alternatively, I think we could make those consts into an array, and hardcode
the array offsets so that they end up as one asm parameter.

That seems reasonable, as long as it's documented what those offsets are referring to...

On 2006-02-21 17:22:26 +0000, Sam Lantinga wrote:

Here's some other interesting info on PIC assembly:
http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml

On 2006-06-21 03:15:47 +0000, Ryan C. Gordon wrote:

While someone will probably complain if we generally drop gcc 2.95 support, it might be worth forcibly disabling the asm on 2.95 in the configure script. These people will still get the working C fallbacks, and we can clean up the code for compilers that shipped within this decade.

--ryan.

On 2007-06-02 13:58:53 +0000, Ryan C. Gordon wrote:

Bumping a bunch of bugs to Priority 1 for consideration for the 1.2.12 release.

--ryan.

On 2007-06-04 04:13:26 +0000, Ryan C. Gordon wrote:

Actually, the trouble with this file, which makes it necessary to use this
strange parameter naming stuff is that old (2.95) gcc versions do not support
enough asm parameters (10). Maybe it's time to drop gcc 2.95 support ?

Stephane, can I get you to put together a patch for this one that uses 10 registers and just uses the C fallbacks #if (GNUC < 3) ?

--ryan.

On 2007-06-04 04:27:13 +0000, Ryan C. Gordon wrote:

...actually, does Attachment # 201 in Bug # 418 cover this issue?

--ryan.

On 2007-06-06 14:30:20 +0000, wrote:

(In reply to comment # 9)

...actually, does Attachment # 201 [details] in Bug # 418 cover this issue?

--ryan.

It looks like it should work (although of course it breaks gcc 2.9x, which I think people weren't prepared to do last time). I'm quite busy ATM though, so I didn't actually test it.

On 2007-06-15 00:27:48 +0000, Ryan C. Gordon wrote:

Tossing bug back to me...

--ryan.

On 2007-06-15 00:36:02 +0000, Ryan C. Gordon wrote:

Eh, tagging this as a dupe of Bug # 418...we'll manage it out of there.

--ryan.

*** This bug has been marked as a duplicate of bug 418 ***

testing

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-27 11:19:41 +0000, Ryan C. Gordon wrote:

This is a new bugzilla entry that should CC sam by default, as the "QA contact".

--ryan.

On 2006-01-27 11:20:06 +0000, Ryan C. Gordon wrote:

Resolving test bug...

--ryan.

On 2006-01-27 11:23:29 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

[Patch] Vertical retrace sync for OpenGL on Mac OS X (Quartz)

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Mac OS X (All), PowerPC

Comments on the original bug report:

On 2006-01-30 13:48:46 +0000, Christian Walther wrote:

On Mac OS X (Quartz), (double-buffered) OpenGL rendering is currently not synchronized to vertical retrace - SDL_GL_SwapBuffers() swaps and returns immediately. The attached patch changes this (see http://lists.apple.com/archives/mac-opengl/2006/Jan/msg00080.html for what it does exactly).

I actually wondered whether there might be a reason this has been unimplemented for so long. I'm not sure what SDL's general policy on vertical retrace syncing for OpenGL is (the SDL_GL_SwapBuffers() documentation doesn't mention it) and I didn't check what other backends do about it, but since for non-OpenGL the policy seems to be "do it if possible" (see the SDL_Flip() documentation), I figured it might not be a bad thing to add. Does everybody agree with that, or might there be an application that depends on the previous behavior? For my own application, the effect is very beneficial - no more tearing, less fan noise, and longer battery life.

The patch has been tested on Mac OS X 10.2.8, 10.3.9, and 10.4.3, and it works both in fullscreen and in windowed mode (on 10.4 even when the window is partially obscured).

On 2006-01-30 13:49:54 +0000, Christian Walther wrote:

Created attachment 55
Quartz GL vsync patch

On 2006-01-30 13:58:28 +0000, Ryan C. Gordon wrote:

There is a parameter for SDL_GL_SetAttribute() to enable this (but the attribute itself may be sitting in another bugzilla entry...). We shouldn't enable it by default, because it hurts framerate, which can be a real problem in some situations.

--ryan.

On 2006-01-30 14:40:59 +0000, Christian Walther wrote:

Ah, you mean https://bugzilla.libsdl.org/show_bug.cgi?id=2 . I saw it before I submitted this bug, but only glanced over it since it seemed to refer to OpenGL extensions (which is not true, it refers to the GLX and WGL equivalents of what I'm doing here). I now examined that patch in more detail and came to the conclusion that it would be trivial to adapt my patch to be the Quartz implementation of the other one. So that's probably the way to go, even if it means waiting for 1.3. It's certainly the cleaner way of making it optional than conditionalizing it on an environment variable, which was my first idea.

On 2006-01-30 14:48:19 +0000, Ryan C. Gordon wrote:

While Bug # 2 is an API change, it doesn't require us to break binary compatibility, so it could be added to 1.2.10...we did this with several other API additions, not the least of which being multisampling support in SDL_GL_SetAttribute() for 1.2.9.

I'm flagging this bug as depending on Bug # 2, since that seems to be the way forward, in any case.

--ryan.

On 2006-04-27 03:59:17 +0000, Sam Lantinga wrote:

This is in SVN, thanks!

Mac OS X fullscreen and fades

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Mac OS X (All), PowerPC

Comments on the original bug report:

On 2006-01-27 12:37:43 +0000, Ryan C. Gordon wrote:

Date: Thu, 26 Jan 2006 09:49:13 -0500 (EST)
From: Gregory Smith [email protected]
To: [email protected]
Subject: [SDL] Mac OS X fullscreen and fades

If I were to make a patch that lets you set an environment variable to
disable the fades when changing to/from fullscreen modes on OS X, would it
be feasible to include in CVS?

I realize those fades are there to hide any flickering that might occur,
but they're painfully long, especially when trying to change resolutions
mid-game.

Gregory

On 2006-01-30 07:40:52 +0000, Sam Lantinga wrote:

Go for it. :)

On 2006-02-04 09:51:10 +0000, Christian Walther wrote:

Created attachment 68
Fast Fade Patch

This is an improved version of Gregory's patch that adds a fast, asynchronous fade-through-black at every transition to or from a fullscreen mode, using Apple's fade API. It works well with my OpenGL app on 10.2, 10.3, and 10.4. It should work in 2D (non-OpenGL) mode too, but I only did minimal testing of that case.
(Here's the discussion on the mailing list, for the record: http://thread.gmane.org/gmane.comp.lib.sdl/25530 )

On 2006-02-05 19:04:23 +0000, Ryan C. Gordon wrote:

Tried it briefly here...fades faster, which is nice, and doesn't go back to the desktop when changing resolutions, which is nicer still.

If there are no objections, I'll apply this patch.

--ryan.

On 2006-02-06 16:35:11 +0000, Sam Lantinga wrote:

(In reply to comment # 3)

Tried it briefly here...fades faster, which is nice, and doesn't go back to the
desktop when changing resolutions, which is nicer still.
If there are no objections, I'll apply this patch.
--ryan.

Please do!

On 2006-02-07 06:18:36 +0000, Ryan C. Gordon wrote:

It's now in CVS, thanks!

--ryan.

configure script copying source files

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-30 12:48:06 +0000, Ryan C. Gordon wrote:

The configure script does this:

Copying ./src/thread/linux/SDL_systhread.c -> src/thread/SDL_systhread.c
Copying ./src/thread/linux/SDL_systhread_c.h -> src/thread/SDL_systhread_c.h
Copying ./src/thread/linux/SDL_syssem.c -> src/thread/SDL_syssem.c
Copying ./src/thread/generic/SDL_syssem_c.h -> src/thread/SDL_syssem_c.h
Copying ./src/thread/linux/SDL_sysmutex.c -> src/thread/SDL_sysmutex.c
Copying ./src/thread/linux/SDL_sysmutex_c.h -> src/thread/SDL_sysmutex_c.h
Copying ./src/thread/linux/SDL_syscond.c -> src/thread/SDL_syscond.c
Copying ./src/thread/generic/SDL_syscond_c.h -> src/thread/SDL_syscond_c.h
Copying ./src/timer/linux/SDL_systimer.c -> src/timer/SDL_systimer.c

...it would be nice if we could just build these in-place, so that debuggers see the right source filenames, and if these get edited, developers are editing the right one. :)

--ryan.

On 2006-01-31 09:07:17 +0000, Sam Lantinga wrote:

I believe this was done because (at the time?) the autoconf stuff didn't support building files in subdirectories without a sub-make.

On 2006-03-09 10:15:40 +0000, Sam Lantinga wrote:

Bye bye automake...

Bad mouse coordinates on mouse down in windowed mode

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 1.2.9
Reported for operating system, platform: Windows (All), x86

Comments on the original bug report:

On 2006-01-09 23:27:12 +0000, Ilya Olevsky wrote:

I'm using SDL 1.2.9 with Visual C++ 7.0 on Windows 2000.

Here's the setup: my game starts in a window, with SDL_WM_GrabInput(SDL_GRAB_ON) to constrain the cursor to the game window. The mouse cursor is outside of the window when the game launches, and when the window appears the cursor is grabbed and placed at the top left corner of the inside of the game window. At this point, if I click the mouse without moving it, the SDL_MOUSEBUTTONDOWN event's mouse coordinates are (65535,65535).

On 2006-01-27 11:23:11 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-14 01:00:49 +0000, Sam Lantinga wrote:

Fixed in CVS, thanks!

"Dynamic X11 code" causes problems on Tru64.

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Other, Other

Comments on the original bug report:

On 2006-01-26 12:47:25 +0000, Hayashi Naoyuki wrote:

If building with --enable-x11-shared=yes, we get runtime errors.
If building with --enable-x11-shared=no, we get compile errors.

  1. X11 library is libX11.so on Tru64 UNIX.

  2. X11 extension library is libXext.so on Tru64 UNIX.
    configure.in is fixed.

  3. _SmtBufferOverflow, _SmtIpError, ipAllocateData and ipUnallocateAndSendData are used in X headers.
    So the code for this is added in SDL_x11dyn.h and SDL_x11sym.h.

  4. If building with --enable-x11-shared=no, the compiler produce the following error.
    cc: Error: SDL_x11sym.h, line 143: In this statement, "_XData32" is not declared. (undeclared)
    cc: Error: SDL_x11sym.h, line 144: In this statement, "_XRead32" is not declared. (undeclared)

  5. If building with --enable-x11-shared=no and not linking with libX11.so, programs using SDL fail and we get following message.
    Xlib: connection to ":0.0" refused by server
    Xlib: XDM authorization key matches an existing client!

It succeeds if retrying XOpenDisplay 1 second later
or if running xhost +localhost on shell.

On 2006-01-26 12:55:12 +0000, Hayashi Naoyuki wrote:

Created attachment 42
SDL12-osf1.patch

These problems are fixed with this patch.

On 2006-01-27 11:23:26 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-01-30 13:22:00 +0000, Ryan C. Gordon wrote:

Fixed in CVS now, thanks!

--ryan.

use ctrl-alt-fn for VT flipping in fbcon?

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-19 04:08:06 +0000, Ryan C. Gordon wrote:

Originally mentioned in Bug # 37 ...

"Using ctrl-alt-fn for flipping instead of alt-fn may help a few games that actually use that key combination. Would such a patch be accepted, or should something like that be configurable (environment variable?)"

--ryan.

On 2006-01-19 07:13:34 +0000, wrote:

The convention in Linux is that alt-fn switches consoles in normal text mode programs (but SVGALIB programs also do this); the exceptions are X and DOSEMU (in raw keyboard mode), who use ctrl-alt-fn.

Perhaps the best approach is to use alt-fn by default but use ctrl-alt-fn if the keyboard is grabbed (SDL_GRAB_ON). Or maybe this works the other way around because of the SDL_GRAB_FULLSCREEN dynamics. I'll code up a patch when I have time.

On 2006-01-27 11:23:16 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-22 01:44:28 +0000, Sam Lantinga wrote:

I've changed CVS code to use Ctrl-Alt-FN to switch vt's

Checking MME in configure script on Tru64

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Other, Other

Comments on the original bug report:

On 2006-01-26 08:38:15 +0000, Hayashi Naoyuki wrote:

This patch enables to check whether to have MME(Tru64 audio).

The following message is produced.
checking for MME audio support... yes (if having MME)
checking for MME audio support... no (if not having MME)

On 2006-01-26 08:40:31 +0000, Hayashi Naoyuki wrote:

Created attachment 41
configure.in patch

On 2006-01-27 11:23:26 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-09 10:14:06 +0000, Sam Lantinga wrote:

This is in CVS.

Implement RSS feeds on libsdl.org for automatic news aggregators

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2006-02-07 14:37:29 +0000, Dmitry Yakimov wrote:

And may be there is a reason to add 'Site' component to Bugzilla 'Product' column.

On 2006-02-08 12:29:02 +0000, Sam Lantinga wrote:

Does anyone have pointers on how to set up an RSS feed?

On 2006-02-08 12:50:31 +0000, Dmitry Yakimov wrote:

Good introduction article about RSS:
http://searchenginewatch.com/sereport/article.php/2175271

RSS step by step:
http://www.petefreitag.com/item/465.cfm

Open source RSS creator:
http://softwaregarden.com/products/listgarden/

You can just generate xml file from news with php.

On 2006-02-26 10:38:58 +0000, Sam Lantinga wrote:

Done!
http://www.libsdl.org/rss/rss.xml

Comments and suggestions are welcome...

On 2006-02-26 10:41:44 +0000, Sam Lantinga wrote:

Created attachment 73
PHP script to generate RSS feed from news

On 2006-02-26 11:13:58 +0000, Ryan C. Gordon wrote:

Sam,

Add this as a child of the tag in the front page's HTML:

<link rel="alternate" type="application/rss+xml" title="SDL news" href="http://www.libsdl.org/rss/rss.xml" />

Then Firefox, Safari on Tiger, and IE7 (etc) will put an RSS icon in the status bar to alert people that there's an RSS feed on the page.

--ryan.

On 2006-02-26 11:32:54 +0000, Ryan C. Gordon wrote:

(Whoops, it's already there, ignore this.)

--ryan.

On 2006-02-26 11:34:00 +0000, Sam Lantinga wrote:

Done, although Firefox doesn't actually fill in the "live bookmark" generated by it... is there something wrong with the feed?

On 2006-02-26 16:46:58 +0000, Sam Lantinga wrote:

Whoops, I had too many w's in the URL. It works fine now.

X11 mouse and focus loss

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Linux, All

Comments on the original bug report:

On 2006-01-27 12:55:06 +0000, Ryan C. Gordon wrote:

Scenario:

A message window pops up and the SDL fullscreen window loses focus. Under the hood, SDL responds to this by reverting to a window, but doesn't seem to unlock the mouse cursor; the cursor sits visible in the center of the newly-windowed SDL surface. This is happening reliably here with both metacity and icewm window managers in a Gnome environment on XFree86 4.3.0 (gentoo's 4.3.0-r3, specifically)...also happens with Metacity on x.org 6.8.2 (Ubuntu 5.10 default).

At the application level, if I call SDL_ShowCursor(1) in my SDL_ACTIVEEVENT handler, the mouse moves correctly across the desktop. So the SDL_ACTIVEEVENT code ends up looking like:

case SDL_ACTIVEEVENT:
    SDL_ShowCursor(event.active.gain ? 0 : 1);
    break;

I've attached a program to demonstrate this. Run it, ssh in to your box and launch an xterm so the SDL window loses focus. See how mouse cursor becomes visible but doesn't move. Exit the new xterm so it goes away and (hopefully) returns focus to your SDL window, and hit ESC to terminate the program.

Rerun program with --showhide to manually show/hide the cursor in the SDL_ACTIVEEVENT handler, which "fixes" the issue.

You may also notice that the windowed SDL surface resists being dragged around by its title bar, but that might just be metacity.

--ryan.

On 2006-01-27 12:55:27 +0000, Ryan C. Gordon wrote:

Tossing to Sam.

--ryan.

On 2006-01-27 12:56:05 +0000, Ryan C. Gordon wrote:

Created attachment 45
Reproduction case.

Attached test program.

--ryan.

On 2006-04-27 06:44:59 +0000, Sam Lantinga wrote:

This is fixed in SVN, thanks!

The nasm blitters should be rewritten in gcc syntax

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: All, x86

Comments on the original bug report:

On 2006-01-31 21:35:55 +0000, wrote:

The nasm blitters currently found under SDL12/src/hermes have numerous issues :

  • the code is not PIC clean, which could result in crashes (and I think this one is the culprit for the crashes when using -O3)
  • that code requires nasm (so it won't work on QNX or Mac OS X86)
  • that code doesn't work on x86_64
  • it adds a dependency on an external tool

The last 3 issues could be solved by doing a gcc rewrite, the first one could be done along the way by carefully saving/restoring ebx.

On 2006-03-15 18:17:15 +0000, Alex Volkov wrote:

The first Hermes issue (PIC) has been resolved a little while back. Hermes nasm code now loads MMX constants via stack and so does not have any static memory variables anymore.

On 2006-05-26 12:55:20 +0000, Kamil Kamiล„ski wrote:

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.1.0/../../../../x86_64-unknown-linux-gnu/bin/ld: build/.libs/SDL_blit_A.o: relocation R_X86_64_PC32 against `BlitRGBtoRGBPixelAlphaMMX3DNOW' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.1.0/../../../../x86_64-unknown-linux-gnu/bin/ld: final link failed: Bad value

Is there any chance to make this working? (compiled with -fPIC)

On 2006-05-26 18:51:25 +0000, wrote:

I think that's a gcc bug. It can probably be worked around by changing :
inline static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info)
into
static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info)

Oh btw, this has nothing to do with that bug.

On 2006-09-23 19:15:33 +0000, Sam Lantinga wrote:

BlitRGBtoRGBPixelAlphaMMX3DNOW() is not inline anymore in subversion.

On 2007-02-03 03:27:34 +0000, Ryan C. Gordon wrote:

Fwiw, the latest nasm builds can generate Intel Mach-O object files for Mac OS X.

I'd be inclined to say getting nasm to target QNX would be a better effort than converting all the Hermes code to GCC format.

If the PIC issues are resolved, I'd be inclined to flag this bug as WONTFIX.

--ryan.

On 2007-02-15 05:55:05 +0000, Ryan C. Gordon wrote:

Hearing nothing, I'm closing this bug as WONTFIX. Having converted more than my share of assembly between GCC and nasm, I can imagine that we'll spend many years debugging it for little gain.

If an x86 platform can't use nasm, it will have to use the C fallbacks. That's how it goes. This would be a massive undertaking, and something that definitely should NOT happen in the 1.2 branch if nothing else.

--ryan.

Bug when freeing a timer (during mutex lock)

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 1.2.9
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-02-16 11:25:41 +0000, Asfand Yar Qazi wrote:

Hi boys'n'girls (ok, so basically boys...)

I think there may be a bug when exclusive-locking a mutex when freeing a timer caused at the end of my application (I hope my terminology is correct - not too good at concurrency terminology, which is bad, because concurrency is teh futur.)

I'm using the RUDL game library (SDL based game library for Ruby) and when my application window terminates and goes off the screen, process doesn't actually end - (i.e. I don't go back to my shell prompt). I have to manually terminate the process by pressing 'ctrl-c' (i.e. it hasn't crashed.)

This is a fully recreatable bug, it happens ALMOST every time (sometimes the process actually terminates successfully, which is wierd.)

Now, I've gdb'ed it while its in this non-terminated state, and here's some info (actually I used ddd but I've reproduced it using plain terminal mode gdb.) The actual script I run is irrelevant - as long as the script makes a SDL timer, this happens. By the way, this bug also happens exactly the same on SDL-1.2.8 as well as SDL-1.2.9. Amazingly, it DIDN'T happen on a 2.4 kernel with GLIBC 2.2.5 (i.e. before NPTL). Now I'm on the latest stable Gentoo.

Here's a dump of a GDB session where I've noticed some strange stuff going on (note stuff inbetween '<' and '>' is my editing):

$ gdb ../common/root/bin/ruby
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) set args test/linktest.rb
(gdb) run
Starting program: /ruby test/linktest.rb
[Thread debugging using libthread_db enabled]
[New Thread -1210422624 (LWP 12988)]
(Init_RUDL())
(Starting video subsystem)
(Starting audio subsystem)
[New Thread -1217238096 (LWP 12991)]
(Starting timer subsystem)
[New Thread -1235706960 (LWP 12993)]
(Starting TTF)
(Reached RUDL_at_exit)
[Thread -1217238096 (zombie) exited]
(Stopping audio subsystem)
(Stopping video subsystem)
(Stopping TTF)
(Quitting the rest of it)
[Thread -1235706960 (zombie) exited]

Program received signal SIGINT, Interrupt.
[Switching to Thread -1210422624 (LWP 12988)]
0xffffe410 in __kernel_vsyscall ()
(gdb) backtrace

0 0xffffe410 in __kernel_vsyscall ()

1 0xb7f2117e in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0

2 0xb7f1dfc7 in _L_mutex_lock_150 () from /lib/tls/libpthread.so.0

3 0xb7f5bfd4 in ?? () from /lib/ld-linux.so.2

4 0x08152fb0 in ?? ()

5 0x00000001 in ?? ()

6 0xbff575b0 in ?? ()

7 0xb7f51542 in fixup () from /lib/ld-linux.so.2

8 0xb7d39df6 in SDL_mutexP (mutex=0xfffffffc) at SDL_sysmutex.c:133

9 0xb7d3a77e in SDL_RemoveTimer (id=0x826bdd8) at SDL_timer.c:221

10 0xb7d5873d in freeEventTimer (freeMe=0xfffffffc) at rudl_timer.c:46

11 0x08070eaa in rb_gc_call_finalizer_at_exit () at gc.c:1855

12 0x08052e65 in ruby_finalize_1 () at eval.c:1488

13 0x08066b73 in ruby_cleanup (ex=0) at eval.c:1523

14 0x08066c31 in ruby_stop (ex=-4) at eval.c:1554

15 0x08066c7f in ruby_run () at eval.c:1575

16 0x080524e8 in main (argc=-4, argv=0xfffffffc, envp=0xbff578a0) at main.c:46

(gdb) frame 10

10 0xb7d5873d in freeEventTimer (freeMe=0xfffffffc) at rudl_timer.c:46

46 SDL_RemoveTimer(freeMe);
(gdb) l
41 }
42
43 ///////////////////////////////// EVENTTIMER
44 void freeEventTimer(SDL_TimerID freeMe)
45 {
46 SDL_RemoveTimer(freeMe);
47 }
48
49 Uint32 timerCallback(Uint32 interval, void *param)
50 {
(gdb) frame 9

9 0xb7d3a77e in SDL_RemoveTimer (id=0x826bdd8) at SDL_timer.c:221

221 SDL_mutexP(SDL_timer_mutex);
(gdb) l
216 {
217 SDL_TimerID t, prev = NULL;
218 SDL_bool removed;
219
220 removed = SDL_FALSE;
221 SDL_mutexP(SDL_timer_mutex);
222 /* Look for id in the linked list of timers /
223 for (t = SDL_timers; t; prev=t, t = t->next ) {
224 if ( t == id ) {
225 if(prev) {
(gdb) l 210
205 if ( ! SDL_timer_threaded ) {
206 SDL_SetError("Multiple timers require threaded events!");
207 return NULL;
208 }
209 SDL_mutexP(SDL_timer_mutex);
210 t = SDL_AddTimerInternal(interval, callback, param);
211 SDL_mutexV(SDL_timer_mutex);
212 return t;
213 }
214
(gdb)
215 SDL_bool SDL_RemoveTimer(SDL_TimerID id)
216 {
217 SDL_TimerID t, prev = NULL;
218 SDL_bool removed;
219
220 removed = SDL_FALSE;
221 SDL_mutexP(SDL_timer_mutex);
222 /
Look for id in the linked list of timers /
223 for (t = SDL_timers; t; prev=t, t = t->next ) {
224 if ( t == id ) {
(gdb)
225 if(prev) {
226 prev->next = t->next;
227 } else {
228 SDL_timers = t->next;
229 }
230 free(t);
231 --SDL_timer_running;
232 removed = SDL_TRUE;
233 list_changed = SDL_TRUE;
234 break;
(gdb)
235 }
236 }
237 #ifdef DEBUG_TIMERS
238 printf("SDL_RemoveTimer(%08x) = %d num_timers = %d thread = %d\n", (Uint32)id, removed, SDL_timer_running, SDL_ThreadID());
239 #endif
240 SDL_mutexV(SDL_timer_mutex);
241 return removed;
242 }
243
244 /
Old style callback functions are wrapped through this */
(gdb) frame 8

8 0xb7d39df6 in SDL_mutexP (mutex=0xfffffffc) at SDL_sysmutex.c:133

133 if ( pthread_mutex_lock(&mutex->id) < 0 ) {
(gdb) l
128 SDL_SetError("pthread_mutex_lock() failed");
129 retval = -1;
130 }
131 }
132 #else
133 if ( pthread_mutex_lock(&mutex->id) < 0 ) {
134 SDL_SetError("pthread_mutex_lock() failed");
135 retval = -1;
136 }
137 #endif
(gdb) frame 9

9 0xb7d3a77e in SDL_RemoveTimer (id=0x826bdd8) at SDL_timer.c:221

221 SDL_mutexP(SDL_timer_mutex);
(gdb) l
216 {
217 SDL_TimerID t, prev = NULL;
218 SDL_bool removed;
219
220 removed = SDL_FALSE;
221 SDL_mutexP(SDL_timer_mutex);
222 /* Look for id in the linked list of timers */
223 for (t = SDL_timers; t; prev=t, t = t->next ) {
224 if ( t == id ) {
225 if(prev) {
(gdb) print SDL_timer_mutex
$1 = (SDL_mutex *) 0x826a9d8
(gdb) frame 8

8 0xb7d39df6 in SDL_mutexP (mutex=0xfffffffc) at SDL_sysmutex.c:133

133 if ( pthread_mutex_lock(&mutex->id) < 0 ) {
(gdb) l
128 SDL_SetError("pthread_mutex_lock() failed");
129 retval = -1;
130 }
131 }
132 #else
133 if ( pthread_mutex_lock(&mutex->id) < 0 ) {
134 SDL_SetError("pthread_mutex_lock() failed");
135 retval = -1;
136 }
137 #endif
(gdb) print mutex
$2 = (SDL_mutex *) 0xfffffffc
(gdb) quit
The program is running. Exit anyway? (y or n) y

Sorry if that's a bit long, I didn't want to leave anything out.

Ideas?

On 2006-05-07 17:16:53 +0000, Sam Lantinga wrote:

I'd like to get this fixed for SDL 1.2.10 release, if possible.

On 2006-05-09 03:17:04 +0000, Sam Lantinga wrote:

I believe this is now fixed in Subversion. What was happening was a freed mutex was being waited on, after the timer subsystem had already been shut down.

Add driver query functions

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2006-01-19 07:44:08 +0000, Sam Lantinga wrote:

We had query functions to list available audio/video drivers before, and pulled them. It might be worth re-adding these for SDL 1.3...

On 2006-01-19 07:45:22 +0000, Sam Lantinga wrote:

Doh, you've already got this on the list. :)

*** This bug has been marked as a duplicate of 43 ***

On 2006-01-27 11:23:17 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

the aalib video driver uses string funcs but doesnt include string.h

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-02-01 20:11:41 +0000, Mike Frysinger wrote:

simple patch, just #include <string.h> in SDL_aavideo.c

On 2006-02-01 20:19:43 +0000, Mike Frysinger wrote:

Created attachment 63
libsdl-aalib-needs-strings.patch

On 2006-02-02 00:35:59 +0000, Ryan C. Gordon wrote:

Fixed in CVS, thanks!

--ryan.

setAppleMenu method on newer OS X SDK

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Mac OS X (All), PowerPC

Comments on the original bug report:

On 2006-01-27 10:53:55 +0000, Ryan C. Gordon wrote:

Compiler warning on the Intel iMacs...

macosx/SDLMain.m: In function '-[SDLMain setupWorkingDirectory:]':
macosx/SDLMain.m:85: warning: pointer targets in passing argument 3 of 'CFURLGetFileSystemRepresentation' differ in signedness
macosx/SDLMain.m: In function 'setApplicationMenu':
macosx/SDLMain.m:158: warning: no '-setAppleMenu:' method found
macosx/SDLMain.m:158: warning: (Messages without a matching method signature
macosx/SDLMain.m:158: warning: will be assumed to return 'id' and accept
macosx/SDLMain.m:158: warning: '...' as arguments.)

--ryan.

On 2006-01-27 11:23:28 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-22 13:10:38 +0000, Max Horn wrote:

Created attachment 91
Fix warnings in SDLMain.m

See here for a discussion about the "setAppleMenu" warning: http://www.allegro.cc/forums/thread/497928.

The attached patch fixes all warning.

On 2006-03-22 17:33:37 +0000, Ryan C. Gordon wrote:

Patch is now in CVS, thanks!

--ryan.

Error compiling on Tru64

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Other, Other

Comments on the original bug report:

On 2006-02-04 23:02:44 +0000, Hayashi Naoyuki wrote:

Building with "--enable-x11-shared=no", the compilation fails.
cc: Error: SDL_x11sym.h, line 148: In this statement,
"_SmtBufferOverflow" is not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr))
^
cc: Error: SDL_x11sym.h, line 149: In this statement, "_SmtIpError" is
not declared. (undeclared)
SDL_X11_SYM(1,void,_SmtIpError,(Display *dpy,register smtDisplayPtr, int))

Tru64 X header has no declaration of _XData32, _SmtBufferOverflow,
_SmtIpError and ipAllocateData.
but these are used by macro.

This problem was fixed once and it succeeded in the compilation.
See Bugzilla # 87.
http://www.libsdl.org/pipermail/sdl-cvs/2006-January/001106.html

But this problem revived by the following committing.
http://www.libsdl.org/pipermail/sdl-cvs/2006-February/001122.html

On 2006-02-04 23:04:46 +0000, Hayashi Naoyuki wrote:

Created attachment 69
SDL12-osf1.patch

On 2006-03-09 10:19:34 +0000, Sam Lantinga wrote:

I believe the current code in CVS works... Can you submit a new bug + patch if there are additional tweaks needed? Thanks!

OS X public beta workaround removal.

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Mac OS X (All), PowerPC

Comments on the original bug report:

On 2006-01-22 03:32:57 +0000, Ryan C. Gordon wrote:

As requested here:
http://article.gmane.org/gmane.comp.lib.sdl/25248

We should clean the OS X public beta junk from SDL at this point.

Sam's confirmation:
http://article.gmane.org/gmane.comp.lib.sdl/25336

--ryan.

On 2006-01-27 11:23:20 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-01-30 13:56:50 +0000, Ryan C. Gordon wrote:

Fixed in CVS.

--ryan.

ALSA latency fixes...

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, All

Comments on the original bug report:

On 2006-01-24 05:01:03 +0000, Ryan C. Gordon wrote:

Forwarded message: -------------------
Date: Thu, 28 Aug 2003 07:43:57 +0300
From: "Mike Gorchak" mike malva ua
Subject: Re: [SDL] SDL Audio Latency Update

Hello, Sam!

SL> Here was my reply:
SL> The reason you have so much latency is the sample buffer size of 16384.
SL> At 22050 Hz, the default mixer frequency, this works out to be:
SL> 16384/22050 = 0.74s of latency.
SL> Since SDL audio drivers usually double-buffer the sound, it works out
SL> to approximately 1.5 seconds of latency.
SL> For interactive applications, I typically use a sample buffer size of
SL> 1024 at 22050 Hz:
SL> 1024/22050 = 0.46s of latency ... much better. :)
SL> If I do that in your app, it becomes much more responsive.

This changes can cause clickering sound due to lack of CPU time to update
sound buffers, because in SDL audio stream played in another thread. For
example ALSA 0.5/0.9 have the configurable policy of sound buffer usage:
SND_PCM_START_DATA and SND_PCM_START_FULL. First define used to direct to
sound engine to start play when first part of data arrived to sound buffers,
second define used to start play after all buffers have been filled.

ALSA 0.9 have the slightly different defines: SND_PCM_START_DATA and
SND_PCM_START_EXPLICIT=SND_PCM_START_LAST, defined in enum snd_pcm_start_t.
But looks like this functionality (function
snd_pcm_sw_params_set_start_mode() ) somehow deprecated, but it works.

Ah, just found that for ALSA 0.9 must be used
snd_pcm_sw_params_set_start_threshold function instead of
snd_pcm_sw_params_set_start_mode to configure sound buffer usage algorithms.
But SDL driver doesn't uses this ability of ALSA. So it would be nice, if
ALSA driver maintainer add this ability. So we'll have large buffers to
avoid underrun condition, and lowest latency :)

P.S. QSA/QNX driver (which is really have the ALSA 0.5 interface) uses this
functionality.

With best regards, Mike Gorchak. E-mail: mike malva ua

On 2006-01-27 11:23:23 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-19 05:42:41 +0000, Sam Lantinga wrote:

I implemented this in CVS. It didn't actually change the latency for me, possibly because there was another application that already had the audio open, but it's the right thing to do.

Renaming XFree86 directory...

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-30 12:53:23 +0000, Ryan C. Gordon wrote:

At some point we should rename the src/video/x11/XFree86 directory, since it is used with other X servers (Xi Graphics, x.org, etc).

--ryan.

On 2006-01-30 12:54:27 +0000, Ryan C. Gordon wrote:

(err, that should be "src/video/XFree86")

--ryan.

On 2006-01-31 09:12:46 +0000, Sam Lantinga wrote:

(In reply to comment # 0)

At some point we should rename the src/video/x11/XFree86 directory, since it is
used with other X servers (Xi Graphics, x.org, etc).

Name? Maybe "Xext" ?

On 2006-01-31 10:36:47 +0000, Ryan C. Gordon wrote:

"Xext" is fine with me.

--ryan.

On 2006-01-31 12:57:30 +0000, Sam Lantinga wrote:

Done!

BlitNtoNPixelAlpha, possible fix

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2006-01-22 03:19:44 +0000, Ryan C. Gordon wrote:

From: Daniel F Moisset [email protected]
To: [email protected]
Date: Thu, 12 Jan 2006 18:29:28 -0300
Subject: [SDL] alpha blending bug - possible fix?

Recently I posted about a problem with alpha blending that turned out to
be a problem with the generic blit function when there is no
acceleration, BlitNtoNPixelAlpha. Alex Volkov pointed me to the
following comment:

/* FIXME: for 8bpp source alpha, this doesn't get opaque values
quite right. for <8bpp source alpha, it gets them very wrong
(check all macros!)
It is unclear whether there is a good general solution that doesn't
need a branch (or a divide). */

The problem is a precision bug at the ALPHA_BLEND macro:

#define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB)
do {
dR = (((sR-dR)(A))>>8)+dR;
dG = (((sG-dG)
(A))>>8)+dG;
dB = (((sB-dB)*(A))>>8)+dB;
} while(0)

you can make a slight correction changing this to:

#define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB)
do {
int premultR = (sR-dR)(A);
int premultG = (sG-dG)
(A);
int premultB = (sB-dB)*(A);
dR += ((premultR>>8)+((A)>>7)+(premultR>>16);
dG += ((premultG>>8)+((A)>>7)+(premultG>>16);
dB += ((premultB>>8)+((A)>>7)+(premultB>>16);
} while(0)

That incurs into some extra shifts and adds, but no division or branch.
The correction is not better on the average (it is slightly worse,
although the maximum error in the function is the same), but it gives
equal or much better results at usual alpha values (0, 128, 255)

could this change be introduced? thanks a lot,

 D.

PS: I tested the formula separately an it works, but have not tried
merging the above into SDL. perhaps something needs to be fixed first

Cheers,
D.

--
Except - Free Software developers for hire - http://except.com.ar


SDL mailing list
[email protected]
http://www.libsdl.org/mailman/listinfo/sdl

On 2006-01-22 03:23:51 +0000, Ryan C. Gordon wrote:

Date: Sat, 21 Jan 2006 01:56:27 +0100
From: Stephane Marchesin [email protected]
To: "A list for developers using the SDL library. (includes SDL-announce)" [email protected]
Subject: Re: [SDL] alpha blending bug - possible fix?

[...quote snipped by ryan for bugzilla posting...]
could this change be introduced? thanks a lot,

Is changing (even slightly) the alpha behaviour for one among many alpha
blitting functions a good idea ?

Stephane


SDL mailing list
[email protected]
http://www.libsdl.org/mailman/listinfo/sdl

On 2006-01-22 03:25:45 +0000, Ryan C. Gordon wrote:

Date: Sat, 21 Jan 2006 13:58:38 +0100 (MET)
From: Mattias Karlsson [email protected]
To: "A list for developers using the SDL library. (includes SDL-announce)" [email protected]
Subject: Re: [SDL] alpha blending bug - possible fix?

[...quotation clipped for bugzilla by ryan...Sam was asking...]

Did you profile your code as opposed to simply dividing by 255?

I have done some quick-and-dirty testing on both UltraSparc3 and
Xeon by blending two arrays. Some preliminary results:

  • gcc 3.4 replaces /255 with a multiply+shift on both processors.
  • The suggested replacement above is on average faster than division, but
    slower than the current shifts.
  • On UltraSparc3 there is hardly any difference in speed between the
    suggested replacement and using division, unless the arrays grow realy,
    realy large.
  • The difference in time between cache-hit and cache-miss is larger than
    the difference between shift and division; division + cache-hit is
    faster than shift + cache-miss.

Note that this is not tested using SDL blitter code, but a seperate
implementation using the three different blending algorithms.

More tests are in progress...


SDL mailing list
[email protected]
http://www.libsdl.org/mailman/listinfo/sdl

On 2006-01-22 14:44:05 +0000, Mattias Karlsson wrote:

My continued testing have revealed two bugs in the suggested algorithm:

For src=255, dest=255 and alpha >= 128 it overflows, giving (modulo 255) the value 0 instead of the expected 255.

For src=0, dest=1 and 0 < alpha < 127 it underflows, giving (modulo 255) the value 255 instead of the expected 0.

Also, "slightly worse" means that it is off-by-one half the time, while shifting is off-by-one only in 1 out of 6 on average.

On 2006-01-22 14:45:00 +0000, Mattias Karlsson wrote:

Created attachment 27
Benchmark program for 3 diffrent alpha algorithms

On 2006-01-27 11:23:19 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-15 10:51:09 +0000, Sam Lantinga wrote:

Thanks for the analysis, Mattias. The fix proposed won't be implemented, although I'm open to suggestion for other fixes that are correct and still speedy. :)

quartz window: explicit release or not?

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Mac OS X (All), PowerPC

Comments on the original bug report:

On 2006-01-27 11:06:53 +0000, Ryan C. Gordon wrote:

http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/src/video/quartz/SDL_QuartzVideo.m

Bob's patch in revision 1.41 disagrees with mine in revision 1.45...figure out which is actually right.

--ryan.

On 2006-01-27 11:23:29 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-22 13:29:46 +0000, Max Horn wrote:

All I can say is that I just verified that
[qz_window isReleasedWhenClosed]
returns true (at the end of QZ_SetVideoWindowed, that is).

On 2006-04-27 06:08:41 +0000, Sam Lantinga wrote:

It definitely sounds like Bob's is right. Can you verify?

On 2006-05-07 17:08:43 +0000, Sam Lantinga wrote:

Can someone confirm this for 1.2.10 release?

On 2006-05-07 18:52:27 +0000, Ryan C. Gordon wrote:

I added some debug printf()s ...

printf("pre close: %d\n", (int) [ qz_window retainCount ] );
[ qz_window close ];
printf("post close: %d\n", (int) [ qz_window retainCount ] );
[ qz_window release ];
printf("post release: %d\n", (int) [ qz_window retainCount ] );

This produces:

pre close: 1
post close: 1
objc: FREED(id): message retainCount sent to freed object=0x11371d0
Trace/BPT trap

The Apple docs say release-when-closed is ignored if the window has a controller...I guess we do in this case. So the explicit release, as it is in svn right now, is correct. No patch needed.

--ryan.

Couldn't set 1920x1200x32 video mode: No video mode large enough for 1920x1200

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 1.2.8
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-24 03:56:53 +0000, wrote:

This has been discussed on the mailing list:
http://www.devolution.com/pipermail/sdl/2005-December/071672.html
Ryan C. Gordon looked at the code and came to the following conclusion:
"Ok, I looked, and there's an obvious answer: we only support up to
1600x1200. :/

It could probably Just Work if someone adds it to checkres and
vesa_timings at the top of src/video/fbcon/SDL_fbvideo.c, though."

Since nothing has happened since then I add the issue to this bug tracking system so it does not fall into oblivion.

On 2006-01-24 04:55:49 +0000, Ryan C. Gordon wrote:

(In reply to comment # 0)

Since nothing has happened since then I add the issue to this bug tracking
system so it does not fall into oblivion.

We already put this in Bugzilla, for this very reason. :)

It was Bug # 23, which I think we decided was handled by the addition of an /etc/fb.modes parser.

--ryan.

*** This bug has been marked as a duplicate of 23 ***

On 2006-01-24 06:07:18 +0000, wrote:

Thanks for fixing :-) So I just have to wait for the release of 1.2.10 then.

On 2006-01-27 11:23:23 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

Include XME code in SDL...

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-12 16:50:38 +0000, Ryan C. Gordon wrote:

It's one small .c file, mostly hooks into Xi's X server extensions. Including this in SDL lets us use the dynamic X11 code, too.

--ryan.

On 2006-01-14 01:57:30 +0000, Ryan C. Gordon wrote:

This is in CVS now.

--ryan.

On 2006-01-27 11:23:13 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

Better approach to VT switching in fbcon driver...

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-19 04:05:37 +0000, Ryan C. Gordon wrote:

Originally mentioned in Bug # 37 ...

"By the way, does anyone know why SDL freezes the application when switched away using fbcon? It could catch a signal for flipping back, and provide a fake frame buffer at a fixed position so that the application can work in the background."

I like the idea, and would be inclined to also post SDL_ACTIVEEVENT events to the SDL app when switching to/from the SDL-controlled virtual terminal.

--ryan.

On 2006-01-27 11:23:16 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-22 02:53:17 +0000, Sam Lantinga wrote:

Out of curiousity, how would we handle the application setting a new video mode while switched away?

On 2006-03-22 03:53:30 +0000, Ryan C. Gordon wrote:

This is why I changed this back from ASSIGNED to NEW. :)

We could spend a lot of time emulating the surface and switching as appropriate, including rebuilding a shadow surface behind the scenes if the vidmode changes.

I think it's possible, but after thinking about it, I'm wondering if it's worth the effort.

--ryan.

On 2006-03-22 04:44:58 +0000, Sam Lantinga wrote:

(In reply to comment # 3)

I think it's possible, but after thinking about it, I'm wondering if it's worth
the effort.

Doesn't seem like it to me.

It would be relatively easy to support switching away as long as the video mode isn't changed, but a completely bulletproof system would be really hard to do.

Here are some notes in case anybody is interested:

  • At video mode set, we'd need to lock the video mode switch.
  • In switch_vt(), we'd just need to keep the saved memory around, set a global variable inside the hw_lock, unlock the vt switch, send an APPACTIVE event, and return.
  • In all code that accesses video memory, we need to check that variable (inside the lock) and return if the switched away variable was true.
  • If the video mode is resized while switched away, I think maybe failing the mode switch is the best way to go.
  • In the event handling code, if we're switched away, lock hw_lock, check to see if we've switched back. If so, relock the vt switch, restore the saved memory, send an APPACTIVE event, clear the global variable, and return.

All in all, pretty easy if we can say that setting a video mode fails. :)

On 2006-03-22 04:48:48 +0000, Sam Lantinga wrote:

Actually, nevermind, we already block in the video mode setting code, until we can set the current vt.

Heheh, it sounds like this would be fairly easy to do... I just hope everybody is checking their return codes. :)

On 2006-03-22 04:53:51 +0000, Ryan C. Gordon wrote:

Dereferencing a NULL pointer is the ultimate return code check. :)

If you think it's trivial and worth doing, feel free to reassign this one to yourself. I'm busy fighting with Xrandr at the moment.

--ryan.

On 2006-03-22 04:56:21 +0000, Sam Lantinga wrote:

You got it. Thanks for tangling with XRandR, btw. :)

On 2006-03-23 03:33:47 +0000, Sam Lantinga wrote:

Created attachment 93
fbcon-nonblocking-switch.diff

Here's a patch to add non-blocking VT switch support. I don't have a working fb at the moment, so could you check it out and apply it if it's good?

On 2006-03-23 03:39:21 +0000, Sam Lantinga wrote:

Whoops, forgot the APPACTIVE stuff. Can you add that while you're at it?

On 2006-03-23 04:11:17 +0000, Ryan C. Gordon wrote:

In switch_vt_done(), should we call SDL_UpdateRect() in all cases? Right now we don't update the display on the return to the SDL VT, so testsprite.c is rendering over the contents of the VT that I switched away to, once I return.

--ryan.

On 2006-03-23 04:25:22 +0000, Ryan C. Gordon wrote:

Also, we'll need to clear the border if the logical resolution is smaller than the physical resolution.

--ryan.

On 2006-05-08 01:32:54 +0000, Sam Lantinga wrote:

This patch, with the addition of always saving/restoring the video memory and the addition of appactive events, is now in Subversion.

On 2006-05-08 01:33:51 +0000, Sam Lantinga wrote:

Just for the record, we should also probably save and restore the entire hardware surface memory pool... Maybe that should be a separate bug?

On 2006-05-10 00:46:32 +0000, Ryan C. Gordon wrote:

If we're going to do that, shouldn't we do it for DirectX, too, and remove the notes about BlitSurface() returning -2 from the docs? If you want to do that, yeah, seperate bug, but I don't know that it's worth it, honestly.

--ryan.

On 2006-05-10 01:06:56 +0000, Sam Lantinga wrote:

(In reply to comment # 14)

If we're going to do that, shouldn't we do it for DirectX, too, and remove the
notes about BlitSurface() returning -2 from the docs? If you want to do that,
yeah, seperate bug, but I don't know that it's worth it, honestly.

DirectX doesn't give you a warning - you can lose surfaces at any time. With the framebuffer console, we're in control, and can do any saving/restoring necessary behind the scenes. Anyway, punting for now.

Querying X11 extensions writes to stderr...

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 1.2.9
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-12 17:23:53 +0000, Ryan C. Gordon wrote:

There's a macro in a header we use to query X11 extensions that writes an error to stderr if the extension is missing...this is most notable when you go fullscreen on Xfree86/x.org when SDL has support for XME. Disable this output.

--ryan.

On 2006-01-12 18:29:30 +0000, Ryan C. Gordon wrote:

Specifically:

This calls XMissingExtension() inside xlib...there's a way to hook into XMissingExtension() to override the default behaviour (need to look it up).

Alternately, we can just hack extutil.h in our source tree, but let's avoid that more than we already do.

--ryan.

On 2006-01-14 03:16:30 +0000, Ryan C. Gordon wrote:

Fixed in CVS.

--ryan.

On 2006-01-27 11:23:14 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

stop using deprecated mutex funcs with newer glibc versions

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-02-01 20:22:04 +0000, Mike Frysinger wrote:

older versions of glibc used pthread_mutexattr_setkind_np() while nowadays it's deprecated in favor of pthread_mutexattr_settype() ... atm, SDL_sysmutex.c always uses the deprecated one on linux systems

patch attached will enable use of the newer func for glibc-2.3.x+ ... or i could write up a configure test to see if libpthread supports pthread_mutexattr_settype() and use that ... doesnt matter to me ;)

On 2006-02-01 20:23:28 +0000, Mike Frysinger wrote:

Created attachment 64
libsdl-older-mutex-funcs.patch

On 2006-02-03 00:52:36 +0000, Sam Lantinga wrote:

(In reply to comment # 0)

older versions of glibc used pthread_mutexattr_setkind_np() while nowadays it's
deprecated in favor of pthread_mutexattr_settype() ... atm, SDL_sysmutex.c
always uses the deprecated one on linux systems

patch attached will enable use of the newer func for glibc-2.3.x+

I have glibc-2.3.5, and PTHREAD_MUTEX_RECURSIVE is only defined if __USE_UNIX98 is defined, which it isn't by default.

However, it's not a bad idea to use it when available, so I'm writing a configure test to do the right thing. Thanks!

On 2006-02-03 01:31:11 +0000, Sam Lantinga wrote:

(In reply to comment # 2)

I have glibc-2.3.5, and PTHREAD_MUTEX_RECURSIVE is only defined if __USE_UNIX98
is defined, which it isn't by default.

You have to define _GNU_SOURCE to get the __USE_UNIX98 API calls.
I'm setting this up in configure.in, thanks!

Unicode keyboard input on Windows NT

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.9
Reported for operating system, platform: Windows (All), x86

Comments on the original bug report:

On 2006-01-10 13:18:02 +0000, Alex Volkov wrote:

Is there any interest in adding Unicode input on NT (and above)? I realize that Win9x does not support the ToUnicode() API, but we can at least support that on NT/2k/XP/etc, while keeping the Ascii input on Win9x.
Would such a patch be desired?

On 2006-01-10 15:39:58 +0000, Ryan C. Gordon wrote:

This would be nice to have...in these cases, you usually end up having to use use LoadLibrary() on system DLLs to see if the Unicode entry points exist, and falling back to ASCII behaviour when then don't...otherwise apps using SDL.dll will refuse to start up on Win95 or whatever.

--ryan.

On 2006-01-10 15:48:14 +0000, Alex Volkov wrote:

Quite so. I'll write up a patch, hopefully soon.

On 2006-01-11 22:18:05 +0000, Alex Volkov wrote:

Created attachment 20
NT Unicode input patch

Here is the patch. Successfully tested on Win2k and Win95, but there is no reason why this would not work on other NT or 9x versions. It should not interfere with the current WinCE code, however, unicode input might work on WinCE, if specifically enabled -- I do not know if WinCE supports the ToUnicode() API, and the MSDN docs are very silent about it.

It turns out, ToUnicode() API is present in Win9x versions of user32.dll, but is essentially a no-op, so the LoadLibrary+GetProcAddress trick would not work. Instead, we have to check which platform we are running on with GetVersionEx().

On 2006-01-14 02:03:00 +0000, Ryan C. Gordon wrote:

An alternate patch was just posted to the mailing list:

http://www.devolution.com/pipermail/sdl/2006-January/072030.html

Alex, can you comment on which direction to go from here? Maybe take parts of each patch, or favor one completely?

--ryan.

On 2006-01-14 09:10:19 +0000, John Popplewell wrote:

Hi,

the main improvements that could be made to my patch would be to make the test for the platform a one-off, and to handle WM_INPUTLANGCHANGE so that the calls to GetKeyboardLayout() and GetLocaleInfo() could be minimized.

However, I don't know whether this matters much, given the rate of WM_KEYDOWN events.

I've not been able to test this on Win95 or WinME, only 98,2K and XP. I could wheel out an old Win95 CD and a spare HD if necessary. I've only ever seen one ME machine, although I might be able to arrange testing there.

It's also worth pointing out that I'm testing with a UK and US keyboard only, although I do have a UK keyboard with sticky labels on that pretends to be a German keyboard!

My main (test) Win98 machine (Western locale) has all the international support (code-pages, fonts etc.) installed, so I've not tried on a typical, minimalist install.

Unless it crashes, I don't see a problem with requiring appropriate international support for input to work correctly. This will probably only affect development/test machines as international users will almost certainly have all the right stuff installed for their keyboard to work in the first place,

regards,
John.

On 2006-01-14 09:59:48 +0000, Alex Volkov wrote:

There are advantages and disadvantages in both patches. Both patches will not work 100% correctly if the translation to Unicode returns more than 1 Unicode char (like with non-spacing accent chars), though I have yet to see a keyboard that produces those. And this is no more broken than the equivalent X11 code.

John's patch has a single copy of SDL_ToUnicode, so it's easier to maintain, however, I really would not want to make all those calls (GetVersionEx, etc.) on every keypress and release.
I cannot testify to John's Left/Right Shift key detection, but I am not very fond of using hardcoded scancodes for that, as scancodes are keyboard-specific. However, in John's defense, Win9x will most likely not even run on exotic hardware that has really weird scancodes, though nothing is guaranteed.

As for Unicode input on Win9x in general, it's a great idea using MultiByteToWideChar() to translate the codepage chars to Unicode, but this will break any current Win9x SDL app that is already relying on codepage chars (and not Unicode). Unlike WinNT, Win9x does not really support Unicode, so the input in done by replacing the 0x80-0xff range with a locale-specific codepage, and some SDL apps may already be abusing this. Myself, I do not care about Win9x all that much, and if those apps break, it's the app vendor's fault, and all the more reason for ppl to switch to NT, but from a maintainer's perspective, this may be better defered to SDL 1.3 to keep the ABI intact.

On 2006-01-14 11:36:27 +0000, John Popplewell wrote:

(In reply to comment # 6)

<snip!>
John's patch has a single copy of SDL_ToUnicode, so it's easier to maintain,
however, I really would not want to make all those calls (GetVersionEx, etc.)
on every keypress and release.
That can be fixed. I'll put another patch together.

I cannot testify to John's Left/Right Shift key detection, but I am not very
fond of using hardcoded scancodes for that, as scancodes are keyboard-specific.
However, in John's defense, Win9x will most likely not even run on exotic
hardware that has really weird scancodes, though nothing is guaranteed.

The scancodes for the shift-keys appear to be the same on all keyboards I've tried, and if they are different it will just act like it does now. Support for an arbitrary number of valid scancodes could be added I suppose.

As for Unicode input on Win9x in general, it's a great idea using
MultiByteToWideChar() to translate the codepage chars to Unicode, but this
will break any current Win9x SDL app that is already relying on codepage
chars (and not Unicode). Unlike WinNT, Win9x does not really support Unicode,
so the input in done by replacing the 0x80-0xff range with a locale-specific
codepage, and some SDL apps may already be abusing this. Myself, I do not care
about Win9x all that much, and if those apps break, it's the app vendor's
fault, and all the more reason for ppl to switch to NT, but from a maintainer's
perspective, this may be better defered to SDL 1.3 to keep the ABI intact.

I don't think this is accurate. My tests suggest that the same problem applies to NT systems with the current version - they also currently receive character codes in "the 0x80-0xff range with a locale-specific codepage" - so the application will break on Win9x and NT.

I've not found an application that does anything like this, but it is difficult to belive that it hasn't happened :-)

Regarding Unicode support in Win9x, once you've got Unicode characters from SDL it would be possible for the application to link to the MS provided 'unicows.dll' if they need transparent Unicode handling,

best regards,
John.

On 2006-01-14 20:04:13 +0000, John Popplewell wrote:

Created attachment 21
ToUnicode() patch for Win9x/ME/2K/XP

This modified patch removes the windib left/right-shift key stuff and minimizes the call overhead when handling WM_KEYDOWN events.

Whilst testing the windib driver I discovered that the left and right shift keys aren't independent e.g. hold down the left-shift key, then toggle the right-shift key - nothing. This isn't how the directx and x11 driver behave, so I dumped those changes.

On 2006-01-15 19:03:51 +0000, John Popplewell wrote:

Created attachment 22
Improved ToUnicode() patch

Use of a function pointer makes the code simpler and more run-time efficient.

On 2006-01-15 20:37:42 +0000, John Popplewell wrote:

Thought some explanation of the GetCodePage() function and the use of MultiByteToWideChar() was in order. MS examples of MultiByteToWideChar() usage use the flag CP_ACP or the value returned by GetACP(). This works (translates an 8-bit code-page relative character into a 16-bit Unicode character) as long as the keyboard mapping matches the code-page of your system. This is probably the case for a lot of users, but not for developers or users who work with multiple languages.

For example, my UK Win98 systems have a system code-page identifier of 1252, which means that MultiByteToWideChar(CP_ACP,...) will work for other countries with the same code-page e.g. German, Spanish etc. If I set the keyboard mapping to Polish (1250) or Greek (1253) I get rubbish.

I wondered how 'notepad' did it and discovered that 'notepad' stops you changing to a keyboard mapping that doesn't share the same code-page as the system! This is how I discovered the WM_INPUTLANGCHANGE / WM_INPUTLANGCHANGEREQUEST messages.

However, 'Wordpad' lets you change the keyboard mapping, and handles all the characters fine - so it can be done!

The call to GetLocaleInfo() using an LCID made from the language identifier returned by GetKeyboardLayout() is just the most direct route I found for getting a code-page identifier that changes with the keyboard mapping, there may be a single function call that does this...

Anyway, sorry for rambling and hope this helps,

cheers,
John.

On 2006-01-16 01:56:45 +0000, Alex Volkov wrote:

Patch looks good, John, except I think the dx5 part wont compile with Visual C 6. VC6 cannot do C99 var declaration intersperced with code, so you should put 'BYTE keystate[256];' back where it was, or simply change vkey above it to
UINT vkey = MapVirtualKey(scancode, 1);

On 2006-01-16 02:07:22 +0000, Alex Volkov wrote:

(In reply to comment # 7)

As for Unicode input on Win9x in general, it's a great idea using
MultiByteToWideChar() to translate the codepage chars to Unicode, but this
will break any current Win9x SDL app that is already relying on codepage
chars (and not Unicode). Unlike WinNT, Win9x does not really support Unicode,
I don't think this is accurate. My tests suggest that the same problem applies
to NT systems with the current version - they also currently receive character
codes in "the 0x80-0xff range with a locale-specific codepage" - so the
application will break on Win9x and NT.

On my Win2k with a Russian keyboard, all the cyrillic keys get translated to '?' by the ToAscii() function, which is what SDL is currently using. Perhaps you were testing with ToAsciiEx()?
On Win95, however, ToAscii() translates the cyrillic keys to the 0xa1-0xff range (codepage 1251, I think).

On 2006-01-16 07:13:10 +0000, John Popplewell wrote:

Created attachment 23
ToUnicode() patch - bug fix for VC6

(In reply to comment # 11)

Patch looks good, John, except I think the dx5 part wont compile with Visual C
6. VC6 cannot do C99 var declaration intersperced with code, so you should put
'BYTE keystate[256];' back where it was, or simply change vkey above it to
UINT vkey = MapVirtualKey(scancode, 1);

Oops! Thanks for prompting me to try VC6, it didn't like my pointer-to-function declaration either. I've been using MSYS/MinGW ...

cheers,
John.

On 2006-01-16 08:07:34 +0000, John Popplewell wrote:

(In reply to comment # 12)

(In reply to comment # 7)

As for Unicode input on Win9x in general, it's a great idea using
MultiByteToWideChar() to translate the codepage chars to Unicode, but this
will break any current Win9x SDL app that is already relying on codepage
chars (and not Unicode). Unlike WinNT, Win9x does not really support Unicode,
I don't think this is accurate. My tests suggest that the same problem applies
to NT systems with the current version - they also currently receive character
codes in "the 0x80-0xff range with a locale-specific codepage" - so the
application will break on Win9x and NT.

On my Win2k with a Russian keyboard, all the cyrillic keys get translated to
'?' by the ToAscii() function, which is what SDL is currently using. Perhaps
you were testing with ToAsciiEx()?
That's possible, I was flailing around for a while :-)

On Win95, however, ToAscii() translates the cyrillic keys to the 0xa1-0xff
range (codepage 1251, I think).

I stand corrected. Interesting. I didn't test with Russian. With Polish, ToAscii() maps the barred-L character to ASCII L and the o-acute is mapped to 0xF3 which is o-acute in code-page 1252 (my default). I get the same effect as you with Russian though.

This is quite good news: doesn't it mean that no application can use a work-round to handle international characters when running on Windows?

I've had a look at some SDL-based projects and haven't (yet) found any that would be affected by this fix. Typically:

  • no use of unicode field, often with a GUI keyboard for name entry
  • ignore characters >= 128 (Tux Paint used to)
  • Works internally with Unicode, so it will just start working the same as on X11 (PyGame)

Advice on the SDL documentation Wiki contains this code fragment:

char ch;
if ( (keysym.unicode & 0xFF80) == 0 ) {
ch = keysym.unicode & 0x7F;
}
else {
printf("An International Character.\n");
}

which I believe will still work.

Do you think it's worth trying to identify affected applications?

best regards,
John.

On 2006-01-16 13:59:05 +0000, Alex Volkov wrote:

(In reply to comment # 14)

This is quite good news: doesn't it mean that no application can use a
work-round to handle international characters when running on Windows?

Technically, yes. No Windows SDL application can abuse the unicode field on Win9x and WinNT right now. And since the unicode field gets non-1252 codepage chars only on Win9x, it should be relatively safe. I seriously doubt anyone is writing and maintaining apps that run only on Win9x right now.

And for languages in the codepage 1252 the behavior will not change with this patch (one of the beauties of UCS/Unicode). Also the code fragment from the wiki that you mentioned will still stand.

Do you think it's worth trying to identify affected applications?

All things considering -- I do not think so. As codepage 1252 remains unchanged, if there are any others, they are abusing the Win9x behavior and should correct their code.

I found this issue with SDL myself while trying to add support for Russian input in a game. Let's just assume that I was the first, since I did not find any other bug reports re this ;-)

On 2006-01-19 03:51:05 +0000, Ryan C. Gordon wrote:

Reassigning this bug to Sam for final deliberation.

Sam, please note that the commit of Bug # 47 makes the latest version of this patch apply with offset warnings, but it otherwise applies cleanly, still.

Alex, John, thank you for all the discussion and cooperation on this bug...the collaboration is really exciting to see!

--ryan.

On 2006-01-19 04:10:30 +0000, Sam Lantinga wrote:

Thanks guys! This patch is now in CVS.

On 2006-01-27 11:23:11 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

'Dead'-key character composition doesn't work

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-02-01 18:09:45 +0000, John Popplewell wrote:

Using a non-English, e.g. Spanish, keyboard mapping on Xorg or XFree86 with a slightly tweaked 'checkkeys' test program (see the mailing list post), various dead-key-followed-by-e.g.-vowel sequences don't produce the correct Unicode character in the unicode field of SDL_keysym.

The correct characters are displayed in non-SDL programs e.g. xterm, konsole. I've tried various versions of Xorg and SDL 1.2.8, 1.2.9 and latest CVS with no luck.

The mailing list post has some specific but not very clear examples :-) I'm hampered by only having a UK and US(laptop) keyboard. Here's a picture of a spanish keyboard I found useful: http://www.forlang.wsu.edu/images/kspanish.gif

On 2006-02-01 18:25:20 +0000, John Popplewell wrote:

Created attachment 62
Xlib test program for Input Method

This test program is based on an Xlib tutorial I found on the web, the existing IM code in SDL, and some changes that make dead-key compose sequences work. The output is a bit like that from the SDL test program checkkeys.

The key changes are the use of XFilterEvent() - the sequences aren't decoded correctly without this, and the removal of a call to XUnsetICFocus().

With a bit of fiddling, I believe this could be made to work in 'SDL_x11events.c', and preserve existing behavior.

'Typical' use of XFilterEvent() isn't possible because it filters out the raw key pressed/release events that we need.

On 2006-02-03 03:33:22 +0000, Sam Lantinga wrote:

Created attachment 66
Xlib test program, extended

Thanks John, this is very helpful!
I

On 2006-02-03 03:40:58 +0000, Sam Lantinga wrote:

(In reply to comment # 2)

With a little more testing, it looks like we can process events with a keycode normally, and then deliver the composed input as a separate message.

For 1.2, we can deliver SDLK_UNKNOWN down with the unicode field set, and then SDLK_UNKNOWN up, for each character.

For 1.3, maybe we should create a separate message for text input? Perhaps even a message for partially composed input and another message for completed input? The completed input can be a phrase of characters (chinese), so maybe the data for the input message should be a sequence of utf-8 or ucs-32 characters?

Thoughts?

On 2006-02-03 03:44:23 +0000, Sam Lantinga wrote:

Does anyone have an asian IME that they can try with these test programs?

On 2006-02-03 07:57:07 +0000, John Popplewell wrote:

(In reply to comment # 3)

With a little more testing, it looks like we can process events with a keycode
normally, and then deliver the composed input as a separate message.
Yes, that seems to be possible. I've nearly got a patch together that covers this.

For 1.2, we can deliver SDLK_UNKNOWN down with the unicode field set, and then
SDLK_UNKNOWN up, for each character.
I had a problem doing this, related to SDL_PrivateKeyboard() which needs SDL_keysym to have a valid 'sym' field in press/release event pairs or it starts rejecting events leaving 'stuck' keys.

I've had some success 'remembering' sym and scancode values from previous X key events which can then be used to fill-in-the-blanks in later messages.

For 1.3, maybe we should create a separate message for text input? Perhaps
even a message for partially composed input and another message for completed
input? The completed input can be a phrase of characters (chinese), so maybe
the data for the input message should be a sequence of utf-8 or ucs-32
characters?

Thoughts?
I don't know enough about the IM/IME stuff yet to have anything to add, but from my recent experiences, initially, ucs-16 seems to be the worst possible choice: a single character can't hold the full character-set, it isn't compact and it isn't C-string safe.

However, Windows uses ucs-16 for wchar, with wobbly support on Win98 for anything else and there's this 'surrogate' scheme allowing the full character-set to be represented using ucs-16 characters, but no (official) support on Win98, and registry settings, as described here: http://www.i18nguy.com/surrogates.html, required for 2K/XP etc. Yuck!

Everyone else punts, and uses utf-8, except where they use ucs-16 (TT fonts?), or ucs-32 (line editing?).

In Tux Paint we want to be able to do case-conversion and others might need ordering. The current (strictly broken) ucs-16 scheme allows a stunt to be pulled where the same wide-character functions can be called on Windows/Linux/OSX in the application (I sneakily cast ucs-16 into wchar_t as they are received, and then back to ucs-16 (redundantly on Windows) when calling SDL_ttf).

Annoyingly, fixing the current scheme will reveal design defects in Windows (No! say it aint so! :-)

Perhaps SDL (>=1.3) could provide a very basic set of support functions and conversions (simple stubs on capable systems) and (yet another!) string type (ucs-32) to alleviate this?

Just some thoughts, I'm not a Unicode wizard.

On 2006-02-03 08:37:13 +0000, John Popplewell wrote:

Created attachment 67
First pass at making composite characters work

This seems to work, but not extensively tested.
Not sure about the multiple ODD_keymap[] entries set to SDL_COMPOSE (prevents sticking keys).
Tried with keyrepeat on and off - seemed OK.
Watch out for the evil 'SDL_dgaevents.c' declarations!
I think the minor refactoring of X11_TranslateKey() is an improvement.
I haven't tested the #ifdef X_HAVE_UTF8_STRING stuff - probably errors in there.

On 2006-02-04 03:37:05 +0000, Sam Lantinga wrote:

(In reply to comment # 6)

Created an attachment (id=67) [edit]
First pass at making composite characters work

I saw your patch after I had almost completed mine... I win!
Can you try out the current CVS and see how it works for you?
Thanks for the bit about mapping the dead keys to SDLK_COMPOSE

no software surfaces with svgalib driver?

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-26 03:11:35 +0000, Sam Lantinga wrote:

Date: Sun, 23 Oct 2005 16:39:03 +0200
From: "A. Schmid" [email protected]
Subject: [SDL] no software surfaces with svgalib driver?

Hi,

I noticed that the SDL (1.2.9) svgalib driver only makes use of linear
addressable (framebuffer) video modes. On older systems (like one of
mine), linear addressable modes are often not available.
Especially for cards with VESA VBE < 2.0 the svgalib vesa driver is
unusable, since VESA only supports framebuffering for VBE 2.0 and later.

The changes necessary to add support for software surfaces seem to be
relatively small. I only had to hack src/video/svga/SDL_svgavideo.c (see
attached patch). The code worked fine for me, but it is no more than a
proof of concept and should be reviewed (probably has a memory leak when
switching modes). It also uses the vgagl library (included in the
svgalib package) and needs to be linked against it.

-Alex

On 2006-01-26 03:12:06 +0000, Sam Lantinga wrote:

Created attachment 39
SDL_svgavideo.diff

On 2006-01-27 11:23:25 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-19 07:04:30 +0000, Sam Lantinga wrote:

A modified version of this patch is now in CVS, thanks!

FIXME: It looks like it wouldn't be too hard to support banked modes directly...

On 2006-03-19 14:06:41 +0000, Sam Lantinga wrote:

I reverted this patch and actually implemented a banked update, which should be slightly faster.

SDL_ListModes on winCE

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.8
Reported for operating system, platform: Windows (CE)/PocketPC, x86

Comments on the original bug report:

On 2006-01-22 03:35:33 +0000, Sam Lantinga wrote:

Date: Mon, 21 Nov 2005 12:24:12 -0800
From: Peter Hanely [email protected]
Subject: [SDL] SDL_ListModes on winCE

As of the latest SDL source I've looked at (1.2.8), SDL_ListModes
returns -1 on winCE, implying any resolution is valid. Would it not
make more sense to return a mode for the current desktop window size?
Code along the lines of:
resx = GetDeviceCaps(GetDC(NULL), HORZRES);
resy = GetDeviceCaps(GetDC(NULL), VERTRES);
should retrieve the info according to research. (test and verify pending)

Also, when running in windowed mode it may be desired to know the max
window size that'll fit.

On 2006-01-22 03:36:44 +0000, Sam Lantinga wrote:

This is actually a valid comment for any platform. There should probably be some way of querying the desktop resolution (on platforms that have a desktop)

On 2006-01-22 03:38:27 +0000, Sam Lantinga wrote:

As of the latest SDL source I've looked at (1.2.8), SDL_ListModes
returns -1 on winCE, implying any resolution is valid. Would it not
make more sense to return a mode for the current desktop window size?

I don't really know how the WinCE port works, is it always fullscreen? If so, then your fix seems reasonable. If there are "windows", then this is consistent with the rest of the drivers (-1 for windowed mode, list for fullscreen mode)

On 2006-01-22 03:43:24 +0000, Ryan C. Gordon wrote:

Dmitry's new GAPI driver for PocketPC from Bug # 47 implements SDL_ListModes correctly for this platform, and is now in CVS, which should get you what you need.

--ryan.

*** This bug has been marked as a duplicate of 47 ***

On 2006-01-23 01:09:17 +0000, Dmitry Yakimov wrote:

WinCE GAPI patch correctly implements SDL_ListModes for GAPI that is always fullscreen. WinDib driver supports Win32 and WinCE at the same time, so DIB_ListModes recognize SDL_FULLSCREEN OK but I found that for WinCE WinDib is compiled with #define NO_CHANGEDISPLAYSETTINGS so it returns -1 all the time. (In fact WinCE apps could be non fullscreen). So I will fix WinDib SDL driver. Thank you Peter.

--Dmitry

On 2006-01-27 11:23:20 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-02 15:04:42 +0000, Dmitry Yakimov wrote:

Fixed!
As well new patch contains:

  • SDL_config_wince.h for WinCE optimal settings.
  • updated evc3/4, VS 2005 projects of SDL.
  • added LoopWave example (please update loopwave.c too to be compiled on wce)
  • new SDL build manner updated for wince.

-- Dmitry

On 2006-03-02 15:05:54 +0000, Dmitry Yakimov wrote:

Created attachment 74
diff + updated project files

On 2006-03-02 23:57:01 +0000, Sam Lantinga wrote:

(In reply to comment # 7)

Created an attachment (id=74) [edit]
diff + updated project files

I committed a version of loopwave.c updated with generic versions of your changes, thanks!

I'm looking at the diff now, and it seems like sometimes you use a (new?) symbol WINCE and sometimes you use the normal _WIN32_WCE symbol. I don't see where WINCE was defined. I was simply treating Windows CE as WIN32 with a specialization as _WIN32_WCE where necessary.

In SDL_getenv.c, you use WINCE_ instead of WINCE at one point.

In SDL_systhread.h, you added WINCE to the WIN32 || OS2 check. Is WIN32 not defined in your setup?

You've reverted some changes in SDL_gapivideo.c and SDL_gapivideo.h, it appears accidentally. It should have the new copyright notice and should use relative include paths.

I don't understand the patch in SDL_wingl.c at all:
@@ -96,7 +96,7 @@
where = SDL_strstr(start, extension);
if (!where) break;

  •           terminator = where + SDL_strlen(extension);
    
  •           terminator = where + (extension);
    

Is that really correct?

Instead of platform #ifdef'ing GetWindowLong, I was going to do this:
#ifndef GetWindowLongPtr
#define GetWindowLongPtr GetWindowLong
#endif
... etc. somewhere convenient - maybe in the SDL_config_*.h

On 2006-03-02 23:57:41 +0000, Sam Lantinga wrote:

Could you take a look at these and submit an updated patch?

Thanks!
--Sam

On 2006-03-03 08:13:02 +0000, Dmitry Yakimov wrote:

WINCE is defined in SDL_platform.h (in diff).

I was simply treating Windows CE as WIN32 with a specialization as _WIN32_WCE where necessary.

It seems to be correct. But it is better to make different config file for wince, just because there are many small differences.
May be it is better to add SDL_config_wince.h but not to add WINCE

In SDL_getenv.c, you use WINCE_ instead of WINCE at one point.

oops, mistyped :)

  •           terminator = where + SDL_strlen(extension);
    
  •           terminator = where + (extension);
    

I did not add that line, do not know where it comes from.
May be just was quick selected and deleted, SDL_strlen(extension) seem to be correct version, of course.

I will review it. Thanks for your comments!

On 2006-03-03 09:15:16 +0000, Dmitry Yakimov wrote:

Created attachment 75
Diff + project files

Done! All the issues you noticed had been cleaned up.
Please review.

On 2006-03-03 09:20:31 +0000, Dmitry Yakimov wrote:

About loopwave.c - do you plan to sumbit wince specific additions?

-- Dmitry

On 2006-03-03 09:49:22 +0000, Dmitry Yakimov wrote:

Created attachment 76
forgotten SDL_config_wince.h

Added forgotten in the latest patch SDL_config_wince.h

On 2006-03-04 03:26:36 +0000, Sam Lantinga wrote:

Dmitry's patch is now in CVS!

Dmitry, I tweaked it a bit, so can you grab CVS to make sure everything works?
I built under eVC++ 3 and 4, and it seems fine here.
I did just use SDL_config_win32.h, since it seems to work well. Feel free to send me WinCE specific tweaks though.

On 2006-03-04 04:09:13 +0000, Dmitry Yakimov wrote:

It is much better to disable using SDL implementations of string.c because WinCE platform contains memcpy, memset and other functions embedded in coredll.dll that are much (several timer) faster even that DWORD copying (of course faster that single char SDL copying routine). These routines use ARM assembler tricks.

I'm to note that WinCE is an embedded platform without hdd and swap file, so its memory manager is optimized for such scenario and SDL internal malloc just won't do.

So it is highly desirable to use:

#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1

in config file.

Did you check loopwave subproject? Current CVS version can't be compiled for wince because missed wince specific changes.

-- Dmitry

X11 Build failure on Solaris

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Solaris, All

Comments on the original bug report:

On 2006-02-07 11:27:17 +0000, Mattias Karlsson wrote:

/pub/anarchy/dva00mkn/sun/bin/gcc -DHAVE_CONFIG_H -I. -I.
-I../../../include -g -O2 -Wall -D__ELF__ -DENABLE_DUMMYVIDEO
-DDISKAUD_SUPPORT -DUSE_DLOPEN -DESD_SUPPORT -I/pkg/esound/0.2.36/include
-I/pkg/audiofile/0.2.6/include -I/usr/openwin/include -DENABLE_X11
-DXTHREADS "-DX11_DYNAMIC="libX11.so.6""
"-DX11EXT_DYNAMIC="libXext.so.6"" -I./include -I./src/video -DENABLE_DGA
-DXFREE86_DGAMOUSE -DDEFAULT_DGAMOUSE -DXFREE86_VM -DXFREE86_VMGAMMA
-DXFREE86_XV -DHAVE_XINERAMA -DHAVE_XIGXME -DHAVE_OPENGL -DHAVE_OPENGL_X11
-D_REENTRANT -DSDL_USE_PTHREADS -DPTHREAD_RECURSIVE_MUTEX -DHAVE_SIGACTION
-DSUNAUDIO_SUPPORT -I../../../include -I../../../include/SDL
-I../../../src -I../../../src/main/solaris -I../../../src/audio
-I../../../src/video -I../../../src/video/Xext/extensions
-I../../../src/events -I../../../src/joystick -I../../../src/cdrom
-I../../../src/thread -I../../../src/timer -I../../../src/endian
-I../../../src/file -I../../../src/thread -MT SDL_x11dga.lo -MD -MP -MF
.deps/SDL_x11dga.Tpo -c SDL_x11dga.c -fPIC -DPIC -o .libs/SDL_x11dga.o
[...Snipped...]
In file included from SDL_x11dyn.h:30,
from SDL_x11video.h:44,
from SDL_x11dga_c.h:23,
from SDL_x11dga.c:32:
/usr/openwin/include/X11/Xlibint.h:46: warning: ignoring #pragma ident
/usr/openwin/include/X11/Xlibint.h:137: error: syntax error before
'xEvent'
In file included from SDL_x11dyn.h:30,
from SDL_x11video.h:44,
from SDL_x11dga_c.h:23,
from SDL_x11dga.c:32:
/usr/openwin/include/X11/Xlibint.h:761: error: syntax error before
'xReply'
/usr/openwin/include/X11/Xlibint.h:836: error: syntax error before
'xReply'
/usr/openwin/include/X11/Xlibint.h:836: warning: no semicolon at end of
struct or union
/usr/openwin/include/X11/Xlibint.h:838: error: syntax error before '}'
token
/usr/openwin/include/X11/Xlibint.h:838: warning: type defaults to 'int' in
declaration of '_XAlignedBuffer'
/usr/openwin/include/X11/Xlibint.h:838: warning: data definition has no
type or storage class
/usr/openwin/include/X11/Xlibint.h:903: error: syntax error before
'xGenericReply'
/usr/openwin/include/X11/Xlibint.h:921: error: syntax error before
'xReply'
/usr/openwin/include/X11/Xlibint.h:931: error: syntax error before
'xReply'
/usr/openwin/include/X11/Xlibint.h:978: error: syntax error before
'xReply'
/usr/openwin/include/X11/Xlibint.h:986: error: syntax error before
'xEvent'
/usr/openwin/include/X11/Xlibint.h:1187: error: syntax error before
'xEvent'
/usr/openwin/include/X11/Xlibint.h:1193: error: syntax error before
'xEvent'
/usr/openwin/include/X11/Xlibint.h:1205: error: syntax error before
'xEvent'
/usr/openwin/include/X11/Xlibint.h:1211: error: syntax error before
'xEvent'
In file included from SDL_x11dyn.h:32,
from SDL_x11video.h:44,
from SDL_x11dga_c.h:23,
from SDL_x11dga.c:32:
../../../src/video/Xext/extensions/extutil.h:112: error: syntax error
before 'xEvent'
../../../src/video/Xext/extensions/extutil.h:119: error: syntax error
before 'xEvent'
In file included from SDL_x11video.h:44,
from SDL_x11dga_c.h:23,
from SDL_x11dga.c:32:
SDL_x11dyn.h:53: error: syntax error before 'xEvent'
SDL_x11dyn.h:55: error: syntax error before 'xEvent'
In file included from SDL_x11dyn.h:59,
from SDL_x11video.h:44,
from SDL_x11dga_c.h:23,
from SDL_x11dga.c:32:
SDL_x11sym.h:136: error: syntax error before 'xReply'
SDL_x11sym.h:137: error: syntax error before 'xGenericReply'
make[3]: *** [SDL_x11dga.lo] Error 1
make[3]: Leaving directory
/import/anarchy/dva00mkn/SDL-1.2/src/video/x11' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory /import/anarchy/dva00mkn/SDL-1.2/src/video'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/import/anarchy/dva00mkn/SDL-1.2/src'
make: *** [all-recursive] Error 1


Adding "-DNEED_EVENTS -DNEED_REPLIES" to CFLAGS makes it build.

However, it apears like x11 headers are included in the wrong order, but I'm not that familliar with development with x11 to say for sure.

On 2006-02-08 03:42:21 +0000, Martin Berglund wrote:

I have failed to reproduce this problem with SDL 1.2.9, despite supposedly having compiled on the very same machines (vega/orion and the ma446 Blade 1k's). Do you have some specific instructions to make it happen?

On 2006-02-08 07:50:07 +0000, Mattias Karlsson wrote:

(In reply to comment # 1)

I have failed to reproduce this problem with SDL 1.2.9, despite supposedly
having compiled on the very same machines (vega/orion and the ma446 Blade
1k's). Do you have some specific instructions to make it happen?

Yes, 1.2.9 works like a charm, however the last CVS snapshot from 2005-02-07 (http://www.libsdl.org/cvs/SDL-1.2.tar.gz) fails to build.

On 2006-02-08 11:51:49 +0000, Martin Berglund wrote:

Created attachment 71
Fix for build on Solaris, reverse include order SDL12/src/video/x11/SDL_x11dyn.h

Right you are, it appears that the issue is that Xlibint.h sets NEED_EVENTS and NEED_REPLIES to pass on to Xproto.h, but Xproto.h is included before Xlibint.h in SDL_x11dyn.h

The included patch does this and fixes the build on Solaris, a bit of inspection of the headers on Linux and AIX suggests that the patch should cause no problems elsewhere either.

On 2006-02-08 15:29:44 +0000, Ryan C. Gordon wrote:

Patch is in CVS now, thanks!

--ryan.

mouse.set_visible + directfb fails

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-26 02:08:34 +0000, Sam Lantinga wrote:

Date: Mon, 17 Nov 2003 04:58:08 -0600
From: Tony Murray [email protected]
Subject: [SDL] mouse.set_visible + directfb fails

the command pygame.mouse.set_visible(0) does not hide the directfb mouse
pointer when useing SDL_VIDEODRIVER="directfb".

I am not sure if this is an sdl or a pygame problem as I don't know about
either's code.

Don't take my word for it, but I think this is a proper example of how to hide
the mouse with directfb:

DFBDisplayLayerConfig dlc;
layer->GetConfiguration( layer, &dlc );
layer->SetCursorOpacity( layer, 0 );

Tony Murray

On 2006-01-27 11:23:25 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-05-07 17:13:18 +0000, Sam Lantinga wrote:

I'd like to get this fixed for SDL 1.2.10 release, if possible.

On 2006-05-08 01:12:40 +0000, Sam Lantinga wrote:

I just tested with SDL in Subversion and the latest version of DirectFB, and this appears to be fixed.

missing SDL_VIDEORESIZE when window is restored from maximised window state

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 1.2.9
Reported for operating system, platform: Windows (All), x86

Comments on the original bug report:

On 2006-01-18 13:35:31 +0000, JernejL wrote:

if a sdl window is maximized i get a SDL_VIDEORESIZE, but when it gets restored back to original size i get no SDL_VIDEORESIZE message, the window size changes when window is restored from maximized state.

On 2006-01-27 11:23:16 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-01-31 10:54:52 +0000, Sam Lantinga wrote:

Date: Wed, 19 Oct 2005 09:18:55 -0400 (EDT)
From: Andrew Corrigan [email protected]
To: [email protected]
Subject: [SDL] bug-report: SDL_VIDEORESIZE event not generated.

I noticed what appears to be a bug in SDL 1.2.9.0 in Windows (it was also
in the previous version). There's a
particular case when I expect an SDL_VIDEORESIZE event to be generated,
but it isn't.

The bug repro. app is here:
http://www.cs.stevens.edu/~acorriga/sdl.zip

Specifically the event is not generated if I maximize the window without
doing anything else, and then click 'restore down' (the button which
replaces 'maximize' when the window is maximized). No event is generated
and hence my glViewport call isn't reached. If I first resize the window
before I maximize and subsequently click 'restore down' an SDL_VIDEORESIZE
event is generated and my call to glViewport is reached.

On 2006-01-31 10:57:54 +0000, Sam Lantinga wrote:

This appears to work in CVS. I tested it with testwm -resize

On 2006-07-08 06:42:33 +0000, Ken Van Hoeylandt wrote:

I have exactly the same problem, with SDL 1.2.10, so I'm pretty sure it isn't fixed...

Basically this is how it failes:

  • Open app with SDL and OpenGL
    (SDL_OPENGL | SDL_HWACCEL | SDL_HWPALETTE | SDL_RESIZABLE)
  • Click maximize
  • Click restore window size
  • Restoring fails to call SDL_VIDEORESIZE

This is how it do

On 2006-07-08 06:45:43 +0000, Ken Van Hoeylandt wrote:

Sorry, forgot to select "Win32" as target OS. (and I don't seem to be able to edit my bug reports?)

On 2007-02-16 02:18:30 +0000, Ryan C. Gordon wrote:

Tried this with the latest Subversion on Windows (with windib, directx, OpenGL and otherwise) and it works.

You won't get a second resize event if you don't call SDL_SetVideoMode() on the first one, though.

--ryan.

loadso C files are #included...

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2006-02-09 13:04:56 +0000, Ryan C. Gordon wrote:

All the C files in the loadso directories are used as #includes in SDL12/src/loadso/loadso.c ... this was done to avoid having to update all the project files for various targets.

Since Sam's reorganizing things, which means the project files will need updating anyhow, now's a good time to fix this.

--ryan.

On 2006-02-10 23:44:10 +0000, Sam Lantinga wrote:

I'm not sure if I'm going to change this though. It turns out that it's a real pain getting automake to conditionally compile source, so #include might be the best option at this point.

I may change the extension to .inc or something so people don't expect them to be standalone source files.

Thoughts?

On 2006-03-09 10:21:35 +0000, Sam Lantinga wrote:

This is fixed in CVS.

Fix for using mousewheel in fbcon mode

This bug report was migrated from our old Bugzilla tracker.

Reported in version: HG 1.2
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-01-21 15:13:28 +0000, Sam Lantinga wrote:

Date: Mon, 24 Feb 2003 13:35:11 +0800
From: "Leonidas" [email protected]
Subject: [SDL] Re: Trigger mouse wheel event -- not in X-environment

I have looked into the codes for the IMPS/2 mouse wheel mode of fbcon driver.
But I found something weird.

Here's the original codes to set a mouse device into IMPS/2 mode in libSDL.
In the file src/video/fbcon/SDL_fbevents.c
In function static int set_imps2_mode(int fd)
...
Uint8 set_imps2[] = {0xf3, 200, 0xf3, 100, 0xf3, 80};
Uint8 reset = 0xff;
fd_set fdset;
struct timeval tv;
int retval = 0;

// Set mouse device fd into IMPS/2 mode
if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
// ??? then RESET it..???
if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
retval = 1;
}
}
...........

Since it sets IMPS/2 mode then reset it, so you will never get a mouse into
IMPS/2 mode to use its wheel.
What I did to make the wheel usable is remove the RESET codes.
....
if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
/*
if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
}
*/
retval = 1;
}
....
And in FB_OpenMouse(_THIS)
Make the device /dev/psaux to be setted into imps2 mode such that it can be
detected its a imps/2 mouse or not.
(my mouse device is on ps2, but the codes only set /dev/input/mice device
originally)
Then I have done, I can use the mouse wheel when SDL uses frame buff driver.

I dont exactly know I did right or wrong, I just change it for my usuage.
Correct me please, if I did something wrong.

Best regards,
Li Tsung Lin
IAP Product Dept. Engineer
EeRise Corp. (Image Processing System, Computer Vision System)
Hsin Tien, Taipei Hsien, Taiwan, R.O.C.
Email: [email protected]
WebSite: Http://www.eerise.com.tw

On 2006-01-27 11:23:19 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-22 02:23:06 +0000, Sam Lantinga wrote:

I fixed this in CVS, I think. Ryan, can you check my changes?

On 2006-03-22 03:36:05 +0000, Ryan C. Gordon wrote:

Works here with fbcon, but it worked before the patch with my hardware, too.

We'll call it good to go. :)

--ryan.

SDL_systimer.c compile fail

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Other, Other

Comments on the original bug report:

On 2006-01-26 07:27:28 +0000, Hayashi Naoyuki wrote:

I tried to compile with gcc on Tru64, and got the following error.
SDL_systimer.c:45:45: error: operator '&&' has no right operand

It succeeds if changing
#if (defined _POSIX_TIMERS && _POSIX_TIMERS > 0)
to
#if (defined _POSIX_TIMERS && _POSIX_TIMERS + 0 > 0)

On 2006-01-26 07:33:49 +0000, Hayashi Naoyuki wrote:

Created attachment 40
SDL12/src/timer/linux/SDL_systimer.c patch

On 2006-01-27 11:23:25 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-02-03 02:44:01 +0000, Sam Lantinga wrote:

This is in CVS, thanks!

Cleaning up application activation/deactivation code on Mac OS X (Quartz)

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Mac OS X (All), PowerPC

Comments on the original bug report:

On 2006-01-19 12:28:27 +0000, Christian Walther wrote:

When writing my patch for # 12, I ended up doing all sorts of changes to the way application/window activating/deactivating is handled in the Quartz backend, resulting in the attached patch. It does make the code a bit cleaner IMHO, but as it might be regarded as a case of "if it ain't broken, don't fix it" I'd like to hear other people's opinion about it. Please shout if some change strikes you as unnecessary or wrong, and I'll explain the reasons behind it. As far as I tested it, it does not introduce any new bugs, but I may well have missed some.

  • The most fundamental change (that triggered most of the others) is irrelevant for the usual single-window SDL applications, it only affects the people who are crazy enough to display other Cocoa windows alongside the SDL window (I'm actually doing this currently, although the additional window only displays debugging info and won't be present in the final product): Before, some things were done on the application becoming active, some on the window becoming key, and some on the window becoming main. Conceptually, all these actions belong to the window becoming key, so that's what I implemented. However, since in a single-window application these three events always happen together, the previous implementation "ain't broken".

  • This slightly changed the meaning of the SDL_APPMOUSEFOCUS flag from SDL_GetAppState(): Before, it meant "window is main and mouse is inside window (or mode is fullscreen)". Now, it means "window is key and mouse is inside window (or mode is fullscreen)". It makes more sense to me that way. (See http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html for a discussion of what key and main windows are.) The other two flags are unchanged: SDL_APPACTIVE = application is not hidden and window is not minimized, SDL_APPINPUTFOCUS = window is key (or mode is fullscreen).

  • As a side effect, the reorganization fixes the following two issues (and maybe others) (but they could also be fixed in less invasive ways):

Situation: While in windowed mode, hide the cursor using SDL_ShowCursor(SDL_DISABLE), move the mouse outside of the window so that the cursor becomes visible again, and SDL_SetVideoMode() to a fullscreen mode.
What happened before revision 1.42: The cursor is visible, but becomes invisible as soon as the mouse is moved (half-desirable).
What happens in revision 1.42 and after (including current CVS): The cursor is visible and stays visible (undesirable).
What happens after my patch: The cursor is invisible from the beginning (desirable).

  • When the cursor is hidden and grabbed, switch away from the application using cmd-tab (which ungrabs and makes the cursor visible), move the cursor outside of the SDL window, then cmd-tab back to the application. In 1.2.8 and in the current CVS, the cursor is re-grabbed, but it stays visible (immovable in the middle of the window). With my patch, the cursor is correctly re-grabbed and hidden. (For some reason, it still doesn't work correctly if you switch back to the application using the dock instead of cmd-tab. I haven't been able to figure out why. I can step over [NSCursor hide] being called in the debugger, but it seems to have no effect.)
  • The patch includes my patch for # 12 (it was easier to obtain using cvs diff that way). If you apply both of them, you will end up with 6 duplicate lines in SDL_QuartzEvents.m.

On 2006-01-19 12:29:22 +0000, Christian Walther wrote:

Created attachment 26
proposed patch

On 2006-01-27 11:23:17 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-03-22 13:49:04 +0000, Max Horn wrote:

Created attachment 92
Proposed patch (Updated to apply to latest CVS)

The patch seems sane to me. I just recompiled SDL CVS with the patch applied. That way, both I and everybody using builds made by me will give it some testing :-). I'll return here when I either think it works fine, or find a problem.

On 2006-03-27 05:47:18 +0000, Max Horn wrote:

So far the patch worked flawlessly for me. I think it could safely be accepted, and would benefit SDL, as it both simplifies and fixes the activation handling.

On 2006-04-13 10:18:04 +0000, Sam Lantinga wrote:

This patch is in CVS, thanks!

On 2006-04-14 09:51:27 +0000, Christian Walther wrote:

Thanks, and thanks for testing, Max.

On 2018-07-08 06:37:33 +0000, terence wrote:

Comment on attachment 92
Proposed patch (Updated to apply to latest CVS)

Index: src/video/quartz/SDL_QuartzEvents.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzEvents.m,v
retrieving revision 1.41
diff -u -d -r1.41 SDL_QuartzEvents.m
--- src/video/quartz/SDL_QuartzEvents.m 21 Mar 2006 00:35:22 -0000 1.41
+++ src/video/quartz/SDL_QuartzEvents.m 22 Mar 2006 18:44:15 -0000
@@ -614,8 +614,10 @@
QZ_PrivateCocoaToSDL (this, p);
}

-static void QZ_DoActivate (_THIS)
-{
+void QZ_DoActivate (_THIS) {
+

  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS | (QZ_IsMouseInWindow (this) ? SDL_APPMOUSEFOCUS : 0));
  • /* Hide the cursor if it was hidden by SDL_ShowCursor() */
    if (!cursor_should_be_visible)
    QZ_HideMouse (this);
    @@ -635,7 +637,9 @@
    }
    }

-static void QZ_DoDeactivate (_THIS) {
+void QZ_DoDeactivate (_THIS) {
+

  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS | SDL_APPMOUSEFOCUS);
/* Get the current cursor location, for restore on activate */
QZ_GetMouseLocation (this, &cursor_loc);

@@ -753,14 +757,9 @@
BOOL isInGameWin;

        #define DO_MOUSE_DOWN(button) do {                                               \
  •                        if ( [ NSApp isActive ] ) {                                      \
    
  •                            if ( isInGameWin ) {                                         \
    
  •                                SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);      \
    
  •                                expect_mouse_up |= 1<<button;                            \
    
  •                            }                                                            \
    
  •                        }                                                                \
    
  •                        else {                                                           \
    
  •                            QZ_DoActivate (this);                                        \
    
  •                        if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {                   \
    
  •                            SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);          \
    
  •                            expect_mouse_up |= 1<<button;                                \
                          }                                                                \
                          [ NSApp sendEvent:event ];                                       \
          } while(0)
    

@@ -916,7 +915,7 @@
QZ_ShowMouse (this);
}
else

  •                if ( isInGameWin && !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
    
  •                if ( isInGameWin && (SDL_GetAppState() & (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS)) == SDL_APPINPUTFOCUS ) {
                  
                      SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
                      if (!cursor_should_be_visible)
    

@@ -950,17 +949,7 @@
break;
case NSFlagsChanged:
break;

  •            case NSAppKitDefined:
    
  •                switch ( [ event subtype ] ) {
    
  •                    case NSApplicationActivatedEventType:
    
  •                        QZ_DoActivate (this);
    
  •                        break;
    
  •                    case NSApplicationDeactivatedEventType:
    
  •                        QZ_DoDeactivate (this);
    
  •                        break;
    
  •                }
    
  •                [ NSApp sendEvent:event ];
    
  •                break;
    
  •                /* case NSAppKitDefined: break; */
                  /* case NSApplicationDefined: break; */
                  /* case NSPeriodic: break; */
                  /* case NSCursorUpdate: break; */
    

Index: src/video/quartz/SDL_QuartzVideo.h

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.h,v
retrieving revision 1.30
diff -u -d -r1.30 SDL_QuartzVideo.h
--- src/video/quartz/SDL_QuartzVideo.h 8 Mar 2006 06:21:04 -0000 1.30
+++ src/video/quartz/SDL_QuartzVideo.h 22 Mar 2006 18:44:16 -0000
@@ -224,3 +224,5 @@
void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p);
void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p);
BOOL QZ_IsMouseInWindow (_THIS);
+void QZ_DoActivate (_THIS);
+void QZ_DoDeactivate (_THIS);
Index: src/video/quartz/SDL_QuartzVideo.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.m,v
retrieving revision 1.57
diff -u -d -r1.57 SDL_QuartzVideo.m
--- src/video/quartz/SDL_QuartzVideo.m 15 Mar 2006 17:46:40 -0000 1.57
+++ src/video/quartz/SDL_QuartzVideo.m 22 Mar 2006 18:44:16 -0000
@@ -560,8 +560,8 @@
/* Save the flags to ensure correct tear-down */
mode_flags = current->flags;

  • /* we're fullscreen, so flag all input states... */
  • SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS | SDL_APPACTIVE);
  • /* Set app state, hide cursor if necessary, ... */
  • QZ_DoActivate(this);
return current;

Index: src/video/quartz/SDL_QuartzWM.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWM.m,v
retrieving revision 1.27
diff -u -d -r1.27 SDL_QuartzWM.m
--- src/video/quartz/SDL_QuartzWM.m 21 Feb 2006 08:47:46 -0000 1.27
+++ src/video/quartz/SDL_QuartzWM.m 22 Mar 2006 18:44:17 -0000
@@ -78,15 +78,14 @@
}

void QZ_HideMouse (_THIS) {

  • BOOL isInGameWin = QZ_IsMouseInWindow (this);
  • if (isInGameWin && cursor_visible) {
  • if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) && cursor_visible) {
    [ NSCursor hide ];
    cursor_visible = NO;
    }
    }

BOOL QZ_IsMouseInWindow (_THIS) {

  • if (mode_flags & SDL_FULLSCREEN) return YES;
  • if (qz_window == nil) return YES; /fullscreen/
    else {
    NSPoint p = [ qz_window mouseLocationOutsideOfEventStream ];
    p.y -= 1.0f; /* Apparently y goes from 1 to h, not from 0 to h-1 (i.e. the "location of the mouse" seems to be defined as "the location of the top left corner of the mouse pointer's hot pixel" */
    @@ -166,7 +165,7 @@
    *p = [ window_view convertPoint:*p fromView: nil ];

    /* We need a workaround in OpenGL mode */

  •    if ( SDL_VideoSurface->flags & SDL_OPENGL ) {
    
  •    if ( SDL_VideoSurface != NULL && (SDL_VideoSurface->flags & SDL_OPENGL) ) {
          p->y = [window_view frame].size.height - p->y;
      }
    
    }
    Index: src/video/quartz/SDL_QuartzWindow.m
    ===================================================================
    RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWindow.m,v
    retrieving revision 1.11
    diff -u -d -r1.11 SDL_QuartzWindow.m
    --- src/video/quartz/SDL_QuartzWindow.m 9 Mar 2006 06:33:21 -0000 1.11
    +++ src/video/quartz/SDL_QuartzWindow.m 22 Mar 2006 18:44:17 -0000
    @@ -208,24 +208,12 @@
  • (void)windowDidBecomeKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS);
  • QZ_DoActivate (current_video);
    }
  • (void)windowDidResignKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS);
    -}

-- (void)windowDidBecomeMain:(NSNotification *)aNotification
-{

  • SDL_VideoDevice this = (SDL_VideoDevice)current_video;
  • if (this && QZ_IsMouseInWindow (this))
  •    SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
    

-}

-- (void)windowDidResignMain:(NSNotification *)aNotification
-{

  • SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS);
  • QZ_DoDeactivate (current_video);
    }

@EnD

On 2018-07-08 08:52:01 +0000, terence wrote:

Comment on attachment 92
Proposed patch (Updated to apply to latest CVS)

Index: src/video/quartz/SDL_QuartzEvents.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzEvents.m,v
retrieving revision 1.41
diff -u -d -r1.41 SDL_QuartzEvents.m
--- src/video/quartz/SDL_QuartzEvents.m 21 Mar 2006 00:35:22 -0000 1.41
+++ src/video/quartz/SDL_QuartzEvents.m 22 Mar 2006 18:44:15 -0000
@@ -614,8 +614,10 @@
QZ_PrivateCocoaToSDL (this, p);
}

-static void QZ_DoActivate (_THIS)
-{
+void QZ_DoActivate (_THIS) {
+

  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS | (QZ_IsMouseInWindow (this) ? SDL_APPMOUSEFOCUS : 0));
  • /* Hide the cursor if it was hidden by SDL_ShowCursor() */
    if (!cursor_should_be_visible)
    QZ_HideMouse (this);
    @@ -635,7 +637,9 @@
    }
    }

-static void QZ_DoDeactivate (_THIS) {
+void QZ_DoDeactivate (_THIS) {
+

  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS | SDL_APPMOUSEFOCUS);
/* Get the current cursor location, for restore on activate */
QZ_GetMouseLocation (this, &cursor_loc);

@@ -753,14 +757,9 @@
BOOL isInGameWin;

        #define DO_MOUSE_DOWN(button) do {                                               \
  •                        if ( [ NSApp isActive ] ) {                                      \
    
  •                            if ( isInGameWin ) {                                         \
    
  •                                SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);      \
    
  •                                expect_mouse_up |= 1<<button;                            \
    
  •                            }                                                            \
    
  •                        }                                                                \
    
  •                        else {                                                           \
    
  •                            QZ_DoActivate (this);                                        \
    
  •                        if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {                   \
    
  •                            SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);          \
    
  •                            expect_mouse_up |= 1<<button;                                \
                          }                                                                \
                          [ NSApp sendEvent:event ];                                       \
          } while(0)
    

@@ -916,7 +915,7 @@
QZ_ShowMouse (this);
}
else

  •                if ( isInGameWin && !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
    
  •                if ( isInGameWin && (SDL_GetAppState() & (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS)) == SDL_APPINPUTFOCUS ) {
                  
                      SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
                      if (!cursor_should_be_visible)
    

@@ -950,17 +949,7 @@
break;
case NSFlagsChanged:
break;

  •            case NSAppKitDefined:
    
  •                switch ( [ event subtype ] ) {
    
  •                    case NSApplicationActivatedEventType:
    
  •                        QZ_DoActivate (this);
    
  •                        break;
    
  •                    case NSApplicationDeactivatedEventType:
    
  •                        QZ_DoDeactivate (this);
    
  •                        break;
    
  •                }
    
  •                [ NSApp sendEvent:event ];
    
  •                break;
    
  •                /* case NSAppKitDefined: break; */
                  /* case NSApplicationDefined: break; */
                  /* case NSPeriodic: break; */
                  /* case NSCursorUpdate: break; */
    

Index: src/video/quartz/SDL_QuartzVideo.h

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.h,v
retrieving revision 1.30
diff -u -d -r1.30 SDL_QuartzVideo.h
--- src/video/quartz/SDL_QuartzVideo.h 8 Mar 2006 06:21:04 -0000 1.30
+++ src/video/quartz/SDL_QuartzVideo.h 22 Mar 2006 18:44:16 -0000
@@ -224,3 +224,5 @@
void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p);
void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p);
BOOL QZ_IsMouseInWindow (_THIS);
+void QZ_DoActivate (_THIS);
+void QZ_DoDeactivate (_THIS);
Index: src/video/quartz/SDL_QuartzVideo.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.m,v
retrieving revision 1.57
diff -u -d -r1.57 SDL_QuartzVideo.m
--- src/video/quartz/SDL_QuartzVideo.m 15 Mar 2006 17:46:40 -0000 1.57
+++ src/video/quartz/SDL_QuartzVideo.m 22 Mar 2006 18:44:16 -0000
@@ -560,8 +560,8 @@
/* Save the flags to ensure correct tear-down */
mode_flags = current->flags;

  • /* we're fullscreen, so flag all input states... */
  • SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS | SDL_APPACTIVE);
  • /* Set app state, hide cursor if necessary, ... */
  • QZ_DoActivate(this);
return current;

Index: src/video/quartz/SDL_QuartzWM.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWM.m,v
retrieving revision 1.27
diff -u -d -r1.27 SDL_QuartzWM.m
--- src/video/quartz/SDL_QuartzWM.m 21 Feb 2006 08:47:46 -0000 1.27
+++ src/video/quartz/SDL_QuartzWM.m 22 Mar 2006 18:44:17 -0000
@@ -78,15 +78,14 @@
}

void QZ_HideMouse (_THIS) {

  • BOOL isInGameWin = QZ_IsMouseInWindow (this);
  • if (isInGameWin && cursor_visible) {
  • if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) && cursor_visible) {
    [ NSCursor hide ];
    cursor_visible = NO;
    }
    }

BOOL QZ_IsMouseInWindow (_THIS) {

  • if (mode_flags & SDL_FULLSCREEN) return YES;
  • if (qz_window == nil) return YES; /fullscreen/
    else {
    NSPoint p = [ qz_window mouseLocationOutsideOfEventStream ];
    p.y -= 1.0f; /* Apparently y goes from 1 to h, not from 0 to h-1 (i.e. the "location of the mouse" seems to be defined as "the location of the top left corner of the mouse pointer's hot pixel" */
    @@ -166,7 +165,7 @@
    *p = [ window_view convertPoint:*p fromView: nil ];

    /* We need a workaround in OpenGL mode */

  •    if ( SDL_VideoSurface->flags & SDL_OPENGL ) {
    
  •    if ( SDL_VideoSurface != NULL && (SDL_VideoSurface->flags & SDL_OPENGL) ) {
          p->y = [window_view frame].size.height - p->y;
      }
    
    }
    Index: src/video/quartz/SDL_QuartzWindow.m
    ===================================================================
    RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWindow.m,v
    retrieving revision 1.11
    diff -u -d -r1.11 SDL_QuartzWindow.m
    --- src/video/quartz/SDL_QuartzWindow.m 9 Mar 2006 06:33:21 -0000 1.11
    +++ src/video/quartz/SDL_QuartzWindow.m 22 Mar 2006 18:44:17 -0000
    @@ -208,24 +208,12 @@
  • (void)windowDidBecomeKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS);
  • QZ_DoActivate (current_video);
    }
  • (void)windowDidResignKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS);
    -}

-- (void)windowDidBecomeMain:(NSNotification *)aNotification
-{

  • SDL_VideoDevice this = (SDL_VideoDevice)current_video;
  • if (this && QZ_IsMouseInWindow (this))
  •    SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
    

-}

-- (void)windowDidResignMain:(NSNotification *)aNotification
-{

  • SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS);
  • QZ_DoDeactivate (current_video);
    }

@EnD

On 2018-07-08 08:52:14 +0000, terence wrote:

Comment on attachment 92
Proposed patch (Updated to apply to latest CVS)

Index: src/video/quartz/SDL_QuartzEvents.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzEvents.m,v
retrieving revision 1.41
diff -u -d -r1.41 SDL_QuartzEvents.m
--- src/video/quartz/SDL_QuartzEvents.m 21 Mar 2006 00:35:22 -0000 1.41
+++ src/video/quartz/SDL_QuartzEvents.m 22 Mar 2006 18:44:15 -0000
@@ -614,8 +614,10 @@
QZ_PrivateCocoaToSDL (this, p);
}

-static void QZ_DoActivate (_THIS)
-{
+void QZ_DoActivate (_THIS) {
+

  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS | (QZ_IsMouseInWindow (this) ? SDL_APPMOUSEFOCUS : 0));
  • /* Hide the cursor if it was hidden by SDL_ShowCursor() */
    if (!cursor_should_be_visible)
    QZ_HideMouse (this);
    @@ -635,7 +637,9 @@
    }
    }

-static void QZ_DoDeactivate (_THIS) {
+void QZ_DoDeactivate (_THIS) {
+

  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS | SDL_APPMOUSEFOCUS);
/* Get the current cursor location, for restore on activate */
QZ_GetMouseLocation (this, &cursor_loc);

@@ -753,14 +757,9 @@
BOOL isInGameWin;

        #define DO_MOUSE_DOWN(button) do {                                               \
  •                        if ( [ NSApp isActive ] ) {                                      \
    
  •                            if ( isInGameWin ) {                                         \
    
  •                                SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);      \
    
  •                                expect_mouse_up |= 1<<button;                            \
    
  •                            }                                                            \
    
  •                        }                                                                \
    
  •                        else {                                                           \
    
  •                            QZ_DoActivate (this);                                        \
    
  •                        if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {                   \
    
  •                            SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);          \
    
  •                            expect_mouse_up |= 1<<button;                                \
                          }                                                                \
                          [ NSApp sendEvent:event ];                                       \
          } while(0)
    

@@ -916,7 +915,7 @@
QZ_ShowMouse (this);
}
else

  •                if ( isInGameWin && !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
    
  •                if ( isInGameWin && (SDL_GetAppState() & (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS)) == SDL_APPINPUTFOCUS ) {
                  
                      SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
                      if (!cursor_should_be_visible)
    

@@ -950,17 +949,7 @@
break;
case NSFlagsChanged:
break;

  •            case NSAppKitDefined:
    
  •                switch ( [ event subtype ] ) {
    
  •                    case NSApplicationActivatedEventType:
    
  •                        QZ_DoActivate (this);
    
  •                        break;
    
  •                    case NSApplicationDeactivatedEventType:
    
  •                        QZ_DoDeactivate (this);
    
  •                        break;
    
  •                }
    
  •                [ NSApp sendEvent:event ];
    
  •                break;
    
  •                /* case NSAppKitDefined: break; */
                  /* case NSApplicationDefined: break; */
                  /* case NSPeriodic: break; */
                  /* case NSCursorUpdate: break; */
    

Index: src/video/quartz/SDL_QuartzVideo.h

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.h,v
retrieving revision 1.30
diff -u -d -r1.30 SDL_QuartzVideo.h
--- src/video/quartz/SDL_QuartzVideo.h 8 Mar 2006 06:21:04 -0000 1.30
+++ src/video/quartz/SDL_QuartzVideo.h 22 Mar 2006 18:44:16 -0000
@@ -224,3 +224,5 @@
void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p);
void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p);
BOOL QZ_IsMouseInWindow (_THIS);
+void QZ_DoActivate (_THIS);
+void QZ_DoDeactivate (_THIS);
Index: src/video/quartz/SDL_QuartzVideo.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.m,v
retrieving revision 1.57
diff -u -d -r1.57 SDL_QuartzVideo.m
--- src/video/quartz/SDL_QuartzVideo.m 15 Mar 2006 17:46:40 -0000 1.57
+++ src/video/quartz/SDL_QuartzVideo.m 22 Mar 2006 18:44:16 -0000
@@ -560,8 +560,8 @@
/* Save the flags to ensure correct tear-down */
mode_flags = current->flags;

  • /* we're fullscreen, so flag all input states... */
  • SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS | SDL_APPACTIVE);
  • /* Set app state, hide cursor if necessary, ... */
  • QZ_DoActivate(this);
return current;

Index: src/video/quartz/SDL_QuartzWM.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWM.m,v
retrieving revision 1.27
diff -u -d -r1.27 SDL_QuartzWM.m
--- src/video/quartz/SDL_QuartzWM.m 21 Feb 2006 08:47:46 -0000 1.27
+++ src/video/quartz/SDL_QuartzWM.m 22 Mar 2006 18:44:17 -0000
@@ -78,15 +78,14 @@
}

void QZ_HideMouse (_THIS) {

  • BOOL isInGameWin = QZ_IsMouseInWindow (this);
  • if (isInGameWin && cursor_visible) {
  • if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) && cursor_visible) {
    [ NSCursor hide ];
    cursor_visible = NO;
    }
    }

BOOL QZ_IsMouseInWindow (_THIS) {

  • if (mode_flags & SDL_FULLSCREEN) return YES;
  • if (qz_window == nil) return YES; /fullscreen/
    else {
    NSPoint p = [ qz_window mouseLocationOutsideOfEventStream ];
    p.y -= 1.0f; /* Apparently y goes from 1 to h, not from 0 to h-1 (i.e. the "location of the mouse" seems to be defined as "the location of the top left corner of the mouse pointer's hot pixel" */
    @@ -166,7 +165,7 @@
    *p = [ window_view convertPoint:*p fromView: nil ];

    /* We need a workaround in OpenGL mode */

  •    if ( SDL_VideoSurface->flags & SDL_OPENGL ) {
    
  •    if ( SDL_VideoSurface != NULL && (SDL_VideoSurface->flags & SDL_OPENGL) ) {
          p->y = [window_view frame].size.height - p->y;
      }
    
    }
    Index: src/video/quartz/SDL_QuartzWindow.m
    ===================================================================
    RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWindow.m,v
    retrieving revision 1.11
    diff -u -d -r1.11 SDL_QuartzWindow.m
    --- src/video/quartz/SDL_QuartzWindow.m 9 Mar 2006 06:33:21 -0000 1.11
    +++ src/video/quartz/SDL_QuartzWindow.m 22 Mar 2006 18:44:17 -0000
    @@ -208,24 +208,12 @@
  • (void)windowDidBecomeKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS);
  • QZ_DoActivate (current_video);
    }
  • (void)windowDidResignKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS);
    -}

-- (void)windowDidBecomeMain:(NSNotification *)aNotification
-{

  • SDL_VideoDevice this = (SDL_VideoDevice)current_video;
  • if (this && QZ_IsMouseInWindow (this))
  •    SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
    

-}

-- (void)windowDidResignMain:(NSNotification *)aNotification
-{

  • SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS);
  • QZ_DoDeactivate (current_video);
    }

@EnD

On 2018-07-08 08:52:31 +0000, terence wrote:

Comment on attachment 92
Proposed patch (Updated to apply to latest CVS)

Index: src/video/quartz/SDL_QuartzEvents.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzEvents.m,v
retrieving revision 1.41
diff -u -d -r1.41 SDL_QuartzEvents.m
--- src/video/quartz/SDL_QuartzEvents.m 21 Mar 2006 00:35:22 -0000 1.41
+++ src/video/quartz/SDL_QuartzEvents.m 22 Mar 2006 18:44:15 -0000
@@ -614,8 +614,10 @@
QZ_PrivateCocoaToSDL (this, p);
}

-static void QZ_DoActivate (_THIS)
-{
+void QZ_DoActivate (_THIS) {
+

  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS | (QZ_IsMouseInWindow (this) ? SDL_APPMOUSEFOCUS : 0));
  • /* Hide the cursor if it was hidden by SDL_ShowCursor() */
    if (!cursor_should_be_visible)
    QZ_HideMouse (this);
    @@ -635,7 +637,9 @@
    }
    }

-static void QZ_DoDeactivate (_THIS) {
+void QZ_DoDeactivate (_THIS) {
+

  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS | SDL_APPMOUSEFOCUS);
/* Get the current cursor location, for restore on activate */
QZ_GetMouseLocation (this, &cursor_loc);

@@ -753,14 +757,9 @@
BOOL isInGameWin;

        #define DO_MOUSE_DOWN(button) do {                                               \
  •                        if ( [ NSApp isActive ] ) {                                      \
    
  •                            if ( isInGameWin ) {                                         \
    
  •                                SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);      \
    
  •                                expect_mouse_up |= 1<<button;                            \
    
  •                            }                                                            \
    
  •                        }                                                                \
    
  •                        else {                                                           \
    
  •                            QZ_DoActivate (this);                                        \
    
  •                        if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {                   \
    
  •                            SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);          \
    
  •                            expect_mouse_up |= 1<<button;                                \
                          }                                                                \
                          [ NSApp sendEvent:event ];                                       \
          } while(0)
    

@@ -916,7 +915,7 @@
QZ_ShowMouse (this);
}
else

  •                if ( isInGameWin && !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
    
  •                if ( isInGameWin && (SDL_GetAppState() & (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS)) == SDL_APPINPUTFOCUS ) {
                  
                      SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
                      if (!cursor_should_be_visible)
    

@@ -950,17 +949,7 @@
break;
case NSFlagsChanged:
break;

  •            case NSAppKitDefined:
    
  •                switch ( [ event subtype ] ) {
    
  •                    case NSApplicationActivatedEventType:
    
  •                        QZ_DoActivate (this);
    
  •                        break;
    
  •                    case NSApplicationDeactivatedEventType:
    
  •                        QZ_DoDeactivate (this);
    
  •                        break;
    
  •                }
    
  •                [ NSApp sendEvent:event ];
    
  •                break;
    
  •                /* case NSAppKitDefined: break; */
                  /* case NSApplicationDefined: break; */
                  /* case NSPeriodic: break; */
                  /* case NSCursorUpdate: break; */
    

Index: src/video/quartz/SDL_QuartzVideo.h

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.h,v
retrieving revision 1.30
diff -u -d -r1.30 SDL_QuartzVideo.h
--- src/video/quartz/SDL_QuartzVideo.h 8 Mar 2006 06:21:04 -0000 1.30
+++ src/video/quartz/SDL_QuartzVideo.h 22 Mar 2006 18:44:16 -0000
@@ -224,3 +224,5 @@
void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p);
void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p);
BOOL QZ_IsMouseInWindow (_THIS);
+void QZ_DoActivate (_THIS);
+void QZ_DoDeactivate (_THIS);
Index: src/video/quartz/SDL_QuartzVideo.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.m,v
retrieving revision 1.57
diff -u -d -r1.57 SDL_QuartzVideo.m
--- src/video/quartz/SDL_QuartzVideo.m 15 Mar 2006 17:46:40 -0000 1.57
+++ src/video/quartz/SDL_QuartzVideo.m 22 Mar 2006 18:44:16 -0000
@@ -560,8 +560,8 @@
/* Save the flags to ensure correct tear-down */
mode_flags = current->flags;

  • /* we're fullscreen, so flag all input states... */
  • SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS | SDL_APPACTIVE);
  • /* Set app state, hide cursor if necessary, ... */
  • QZ_DoActivate(this);
return current;

Index: src/video/quartz/SDL_QuartzWM.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWM.m,v
retrieving revision 1.27
diff -u -d -r1.27 SDL_QuartzWM.m
--- src/video/quartz/SDL_QuartzWM.m 21 Feb 2006 08:47:46 -0000 1.27
+++ src/video/quartz/SDL_QuartzWM.m 22 Mar 2006 18:44:17 -0000
@@ -78,15 +78,14 @@
}

void QZ_HideMouse (_THIS) {

  • BOOL isInGameWin = QZ_IsMouseInWindow (this);
  • if (isInGameWin && cursor_visible) {
  • if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) && cursor_visible) {
    [ NSCursor hide ];
    cursor_visible = NO;
    }
    }

BOOL QZ_IsMouseInWindow (_THIS) {

  • if (mode_flags & SDL_FULLSCREEN) return YES;
  • if (qz_window == nil) return YES; /fullscreen/
    else {
    NSPoint p = [ qz_window mouseLocationOutsideOfEventStream ];
    p.y -= 1.0f; /* Apparently y goes from 1 to h, not from 0 to h-1 (i.e. the "location of the mouse" seems to be defined as "the location of the top left corner of the mouse pointer's hot pixel" */
    @@ -166,7 +165,7 @@
    *p = [ window_view convertPoint:*p fromView: nil ];

    /* We need a workaround in OpenGL mode */

  •    if ( SDL_VideoSurface->flags & SDL_OPENGL ) {
    
  •    if ( SDL_VideoSurface != NULL && (SDL_VideoSurface->flags & SDL_OPENGL) ) {
          p->y = [window_view frame].size.height - p->y;
      }
    
    }
    Index: src/video/quartz/SDL_QuartzWindow.m
    ===================================================================
    RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWindow.m,v
    retrieving revision 1.11
    diff -u -d -r1.11 SDL_QuartzWindow.m
    --- src/video/quartz/SDL_QuartzWindow.m 9 Mar 2006 06:33:21 -0000 1.11
    +++ src/video/quartz/SDL_QuartzWindow.m 22 Mar 2006 18:44:17 -0000
    @@ -208,24 +208,12 @@
  • (void)windowDidBecomeKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS);
  • QZ_DoActivate (current_video);
    }
  • (void)windowDidResignKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS);
    -}

-- (void)windowDidBecomeMain:(NSNotification *)aNotification
-{

  • SDL_VideoDevice this = (SDL_VideoDevice)current_video;
  • if (this && QZ_IsMouseInWindow (this))
  •    SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
    

-}

-- (void)windowDidResignMain:(NSNotification *)aNotification
-{

  • SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS);
  • QZ_DoDeactivate (current_video);
    }

@EnD

On 2018-07-08 08:53:35 +0000, terence wrote:

Comment on attachment 92
Proposed patch (Updated to apply to latest CVS)

Index: src/video/quartz/SDL_QuartzEvents.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzEvents.m,v
retrieving revision 1.41
diff -u -d -r1.41 SDL_QuartzEvents.m
--- src/video/quartz/SDL_QuartzEvents.m 21 Mar 2006 00:35:22 -0000 1.41
+++ src/video/quartz/SDL_QuartzEvents.m 22 Mar 2006 18:44:15 -0000
@@ -614,8 +614,10 @@
QZ_PrivateCocoaToSDL (this, p);
}

-static void QZ_DoActivate (_THIS)
-{
+void QZ_DoActivate (_THIS) {
+

  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS | (QZ_IsMouseInWindow (this) ? SDL_APPMOUSEFOCUS : 0));
  • /* Hide the cursor if it was hidden by SDL_ShowCursor() */
    if (!cursor_should_be_visible)
    QZ_HideMouse (this);
    @@ -635,7 +637,9 @@
    }
    }

-static void QZ_DoDeactivate (_THIS) {
+void QZ_DoDeactivate (_THIS) {
+

  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS | SDL_APPMOUSEFOCUS);
/* Get the current cursor location, for restore on activate */
QZ_GetMouseLocation (this, &cursor_loc);

@@ -753,14 +757,9 @@
BOOL isInGameWin;

        #define DO_MOUSE_DOWN(button) do {                                               \
  •                        if ( [ NSApp isActive ] ) {                                      \
    
  •                            if ( isInGameWin ) {                                         \
    
  •                                SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);      \
    
  •                                expect_mouse_up |= 1<<button;                            \
    
  •                            }                                                            \
    
  •                        }                                                                \
    
  •                        else {                                                           \
    
  •                            QZ_DoActivate (this);                                        \
    
  •                        if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {                   \
    
  •                            SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);          \
    
  •                            expect_mouse_up |= 1<<button;                                \
                          }                                                                \
                          [ NSApp sendEvent:event ];                                       \
          } while(0)
    

@@ -916,7 +915,7 @@
QZ_ShowMouse (this);
}
else

  •                if ( isInGameWin && !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
    
  •                if ( isInGameWin && (SDL_GetAppState() & (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS)) == SDL_APPINPUTFOCUS ) {
                  
                      SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
                      if (!cursor_should_be_visible)
    

@@ -950,17 +949,7 @@
break;
case NSFlagsChanged:
break;

  •            case NSAppKitDefined:
    
  •                switch ( [ event subtype ] ) {
    
  •                    case NSApplicationActivatedEventType:
    
  •                        QZ_DoActivate (this);
    
  •                        break;
    
  •                    case NSApplicationDeactivatedEventType:
    
  •                        QZ_DoDeactivate (this);
    
  •                        break;
    
  •                }
    
  •                [ NSApp sendEvent:event ];
    
  •                break;
    
  •                /* case NSAppKitDefined: break; */
                  /* case NSApplicationDefined: break; */
                  /* case NSPeriodic: break; */
                  /* case NSCursorUpdate: break; */
    

Index: src/video/quartz/SDL_QuartzVideo.h

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.h,v
retrieving revision 1.30
diff -u -d -r1.30 SDL_QuartzVideo.h
--- src/video/quartz/SDL_QuartzVideo.h 8 Mar 2006 06:21:04 -0000 1.30
+++ src/video/quartz/SDL_QuartzVideo.h 22 Mar 2006 18:44:16 -0000
@@ -224,3 +224,5 @@
void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p);
void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p);
BOOL QZ_IsMouseInWindow (_THIS);
+void QZ_DoActivate (_THIS);
+void QZ_DoDeactivate (_THIS);
Index: src/video/quartz/SDL_QuartzVideo.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzVideo.m,v
retrieving revision 1.57
diff -u -d -r1.57 SDL_QuartzVideo.m
--- src/video/quartz/SDL_QuartzVideo.m 15 Mar 2006 17:46:40 -0000 1.57
+++ src/video/quartz/SDL_QuartzVideo.m 22 Mar 2006 18:44:16 -0000
@@ -560,8 +560,8 @@
/* Save the flags to ensure correct tear-down */
mode_flags = current->flags;

  • /* we're fullscreen, so flag all input states... */
  • SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS | SDL_APPACTIVE);
  • /* Set app state, hide cursor if necessary, ... */
  • QZ_DoActivate(this);
return current;

Index: src/video/quartz/SDL_QuartzWM.m

RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWM.m,v
retrieving revision 1.27
diff -u -d -r1.27 SDL_QuartzWM.m
--- src/video/quartz/SDL_QuartzWM.m 21 Feb 2006 08:47:46 -0000 1.27
+++ src/video/quartz/SDL_QuartzWM.m 22 Mar 2006 18:44:17 -0000
@@ -78,15 +78,14 @@
}

void QZ_HideMouse (_THIS) {

  • BOOL isInGameWin = QZ_IsMouseInWindow (this);
  • if (isInGameWin && cursor_visible) {
  • if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) && cursor_visible) {
    [ NSCursor hide ];
    cursor_visible = NO;
    }
    }

BOOL QZ_IsMouseInWindow (_THIS) {

  • if (mode_flags & SDL_FULLSCREEN) return YES;
  • if (qz_window == nil) return YES; /fullscreen/
    else {
    NSPoint p = [ qz_window mouseLocationOutsideOfEventStream ];
    p.y -= 1.0f; /* Apparently y goes from 1 to h, not from 0 to h-1 (i.e. the "location of the mouse" seems to be defined as "the location of the top left corner of the mouse pointer's hot pixel" */
    @@ -166,7 +165,7 @@
    *p = [ window_view convertPoint:*p fromView: nil ];

    /* We need a workaround in OpenGL mode */

  •    if ( SDL_VideoSurface->flags & SDL_OPENGL ) {
    
  •    if ( SDL_VideoSurface != NULL && (SDL_VideoSurface->flags & SDL_OPENGL) ) {
          p->y = [window_view frame].size.height - p->y;
      }
    
    }
    Index: src/video/quartz/SDL_QuartzWindow.m
    ===================================================================
    RCS file: /home/sdlweb/libsdl.org/cvs/SDL12/src/video/quartz/SDL_QuartzWindow.m,v
    retrieving revision 1.11
    diff -u -d -r1.11 SDL_QuartzWindow.m
    --- src/video/quartz/SDL_QuartzWindow.m 9 Mar 2006 06:33:21 -0000 1.11
    +++ src/video/quartz/SDL_QuartzWindow.m 22 Mar 2006 18:44:17 -0000
    @@ -208,24 +208,12 @@
  • (void)windowDidBecomeKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS);
  • QZ_DoActivate (current_video);
    }
  • (void)windowDidResignKey:(NSNotification *)aNotification
    {
  • SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS);
    -}

-- (void)windowDidBecomeMain:(NSNotification *)aNotification
-{

  • SDL_VideoDevice this = (SDL_VideoDevice)current_video;
  • if (this && QZ_IsMouseInWindow (this))
  •    SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
    

-}

-- (void)windowDidResignMain:(NSNotification *)aNotification
-{

  • SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS);
  • QZ_DoDeactivate (current_video);
    }

@EnD

X11 vidmode selection: user vs server

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 1.2
Reported for operating system, platform: Linux, All

Comments on the original bug report:

On 2006-01-24 05:07:16 +0000, Ryan C. Gordon wrote:

(pretty sure this never got fixed...look into it! --ryan.)

Date: 21 Apr 2003 17:20:20 +0100
From: Alan Swanson [email protected]
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.

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.

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

For the best match (I don't like the goto but was following prior code)
we still search for the nearest larger size and then try to find a
higher version of it.

I've included two patches;

Before the current CVS showing the error : sdl-x11-vidmode.diff
The second patches the reverts CVS code : sdl-x11-vidmode-cvs.diff

Enjoy. Just in time to play Majesty too!

Alan.

On 2006-01-24 05:08:15 +0000, Ryan C. Gordon wrote:

Created attachment 36
first patch

On 2006-01-24 05:08:52 +0000, Ryan C. Gordon wrote:

Created attachment 37
second patch

(Please note that these patches are from 2003...they probably need to be updated for CVS.)

--ryan.

On 2006-01-27 11:23:24 +0000, Ryan C. Gordon wrote:

Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.

On 2006-05-05 01:51:58 +0000, Sam Lantinga wrote:

I've implemented a fix based on your description, and tested it against X.Org 6.8.2, which has the same behavior. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.