Grabbed Mouse after crash on Linux

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi folks.

I have this problem with a crashing SDL application, it leaves the mouse
pointer useless and I have to restart my X.
Is there a way to regain control of the pointer?

Bye Jochen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB+LdP+j/kFCqJZGwRAvjDAJ9ESR2FE9Px2ONZADbhuQw/z4mGfgCfRA+X
jWLt7/yQurhmnUtqPuGJGiY=
=ewe8
-----END PGP SIGNATURE-----

I am one of those guys that bought a Mac mini, to give OS X a whirl.
So far I am very impressed. However I have an SDL question:

I downloaded and installed the SDL and SDL development packages for
Mac OS X that integrate with Xcode. Cool so far, but then I went to
install some of the libraries such as SDL_image, SDL_mixer, SDL_ttf,
etc. There were no pre-bult packages, so I thought I would just build
them. However, there does not appear to be an sdl-config script, so
the packages fail.

So it seems like there are 2 paths for SDL development on the OS X platform:

  1. Native Xcode: integrates well with OS X, but no libraries.

  2. X11 mode: have libraries, but user must have X11 installed.

Is my understanding of the situation correct?

Thank you,
Chris–
Chris Nystrom
http://www.newio.org/~ccn
AIM: nystromchris

So it seems like there are 2 paths for SDL development on the OS X
platform:

  1. Native Xcode: integrates well with OS X, but no libraries.
  1. X11 mode: have libraries, but user must have X11 installed.

Building SDL with Xcode didn’t work here, so I went with the simpler
command line way to create “.dylib” shared libraries.

./configure, make, make install (optionnal) then some tweaks with
install_name_tool to be able to put the dylibs in the directory of the
executable. Once you know what must be done, it doesn’t take too much
time…

Depending on your needs you’ll have to build libjpeg, libpng, libogg,
libvorbis, etc. I suggest that you build static and not shared versions
of those libs if you want them linked statically to
SDL_image/SDL_mixer. This is usually done with a ./configure option
like “–disable-shared”.On 27/01/2005, Chris Nystrom, you wrote:


Please remove “.ARGL.invalid” from my email when replying.
Incoming HTML mails are automatically deleted.

Not quite.

What you’re actually looking at are two different library types,
Framework vs. dylib (mac os x name for a .so). Essentially, the Mac OS
X concept of a shared lib vs the unix concept. Both are usable, and
they will both get you the same functioanlity (ie, native window system).

The dylib/so approach will be most familiar to those from a unix
background. Put the the sdl dylib in /usr/lib (or /sw/lib if you are
using fink, as you should be). Headers are put in /usr/include/SDL (or
/sw/include/SDL). You get these downloading the SDL sources and doing a
configure/make, or using fink. sdl-config will then be available.

By downloading the Mac OS X dev packages, you got the frameworks.
Frameworks are a directory (named foo.framework), that contain not only
the dylib, but also all the headers, and other supporting files.
Everything related to the framework comes in a single folder, rather
than scattering files between /usr/lib, bin, include, share, etc. The
frameworks do not include sdl-config, because it is unnecessary.

There was recently a discussion about which is best. I’m just going to
say go with the Frameworks. When redistributing your app, place the SDL
and SDL_image frameworks in YourAppBundle.app/Contents/Frameworks.

As for getting SDL_image and SDL_mixer to work, you’ll need frameworks
for those too. If binaries are not available, then you can build them
yourself using xcode. In the SDL_image,mixer,ttf source distributions,
there is a file, PBProjects.tar.gz, which contains xcode projects to
create these. Place them in ~/Library/Frameworks for ease of
development, and then put them in AppBundle.app/Contents/Frameworks when
redistributing your binary.

Richard Schreyer

Chris Nystrom wrote:> I am one of those guys that bought a Mac mini, to give OS X a whirl.

So far I am very impressed. However I have an SDL question:

I downloaded and installed the SDL and SDL development packages for
Mac OS X that integrate with Xcode. Cool so far, but then I went to
install some of the libraries such as SDL_image, SDL_mixer, SDL_ttf,
etc. There were no pre-bult packages, so I thought I would just build
them. However, there does not appear to be an sdl-config script, so
the packages fail.

So it seems like there are 2 paths for SDL development on the OS X platform:

  1. Native Xcode: integrates well with OS X, but no libraries.

  2. X11 mode: have libraries, but user must have X11 installed.

Is my understanding of the situation correct?

Thank you,
Chris

So it seems like there are 2 paths for SDL development on the OS X
platform:

  1. Native Xcode: integrates well with OS X, but no libraries.
  1. X11 mode: have libraries, but user must have X11 installed.

Building SDL with Xcode didn’t work here, so I went with the simpler
command line way to create “.dylib” shared libraries.

Yikes! I finally checked the website and yes indeed, the OS X
framework pacakges for SDL_image and friends seem to be missing. I had
agreed to update all the projects for Xcode, but I haven’t gotten
around to it yet. I thought a release went out, but apparently those
are waiting on me.

I am surprised surprised to hear that building SDL with Xcode didn’t
work for you. Are you building SDL or one of the SDL satellite
projects (SDL_image, SDL_mixer, etc)? Can you tell me what errors
you’re getting?

No promises on a time frame, but I’ll try to take a crack at it this weekend.

-Eric> From: Olivier Fabre

On 27/01/2005, Chris Nystrom, you wrote:

I downloaded and installed the SDL and SDL development
packages for Mac OS X that integrate with Xcode. Cool so
far, but then I went to install some of the libraries such
as SDL_image, SDL_mixer, SDL_ttf, etc. There were no
pre-bult packages, so I thought I would just build them.
However, there does not appear to be an sdl-config
script, so the packages fail.

I’m not sure about SDL_image, and SDL_ttf, but there is a file in the
SDL_mixer source tar.gz called “PBProjects.tar.gz”. If you unpack
this you should be able to use the contents to build the SDL_mixer
framework from the source using XCode.

I have created a custom sdl-config script that I keep in ~/bin to use
when I build things that need it. It’s output looks like this:

$ sdl-config --cflags
-F/Users/yourname/Library/Frameworks
-I/Users/yourname/Library/Frameworks/SDL.framework/Headers
-D_REENTRANT

$ sdl-config --libs
/Users/yourname/bin/SDLMain.o -L/Users/yourname/Library/Frameworks
-framework Cocoa -framework SDL -lobjc

Email me if you want and I’ll send it to you. (As you can see, I keep
a pre-built SDLMain.o lying around for such occasions.)

Speaking of SDLMain, you may want to grab a much better version of
SDLMain.m from the CVS repository:

http://www.libsdl.org/cgi/cvsweb.cgi/SDL12/src/main/macosx/

(I’m using revision 1.11.2.1). The version included in the SDL 1.2.8
package has problems with receiving keyboard events when you run SDL
apps that are not in an application bundle (i.e. command-line
launched ones.) The new version also creates a nice application menu
for you when you’re not using a NIB.__
Steve

Find local movie times and trailers on Yahoo! Movies.

I downloaded and installed the SDL and SDL development
packages for Mac OS X that integrate with Xcode. Cool so
far, but then I went to install some of the libraries
such
as SDL_image, SDL_mixer, SDL_ttf, etc. There were no
pre-bult packages, so I thought I would just build them.
However, there does not appear to be an sdl-config
script, so the packages fail.

If you build SDL from source (and maybe if you install the development
packages), sdl-config should be placed in /usr/local/bin. However, the
default path on OS X does not include /usr/local/bin, so sdl-config will not
be found. Fix the path and you’re set.

Sorry if this has already been said; I missed the beginning of the thread.–
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com

Steven Saunders wrote:

I have created a custom sdl-config script that I keep in ~/bin to use
when I build things that need it.

Cool. If I understand correctly, that means that you can now compile
command-line applications that use sdl-config in their configure scripts
and they automatically use the framework instead of libraries in
/usr/local/lib or wherever? I’ve been keeping around a fink-installed
"command-line" SDL in /sw for those cases and the frameworks in
~/Library/Frameworks for my own development in Xcode, but having only
one SDL installation would be much more elegant. I think such a script
should be included in the SDL Mac OS X packages (maybe as an optional
install). What do others think?

-Christian

'lo E.,

I am surprised surprised to hear that building SDL with Xcode didn’t
work for you. Are you building SDL or one of the SDL satellite
projects (SDL_image, SDL_mixer, etc)? Can you tell me what errors
you’re getting?

Looks like the compilation doesn’t work when “cross compiling” to 10.1.
I’m not sure but I think it works when I choose to compile for the
"current os" (which is 10.3.7).

Regards

I have created a custom sdl-config script that I keep in ~/bin to use
when I build things that need it. It’s output looks like this:

$ sdl-config --cflags
-F/Users/yourname/Library/Frameworks
-I/Users/yourname/Library/Frameworks/SDL.framework/Headers
-D_REENTRANT

$ sdl-config --libs
/Users/yourname/bin/SDLMain.o -L/Users/yourname/Library/Frameworks
-framework Cocoa -framework SDL -lobjc

Email me if you want and I’ll send it to you. (As you can see, I keep
a pre-built SDLMain.o lying around for such occasions.)

Thank you for your post. Alot of helpful information in there.

Can you e-mail your custom sdl-config?

Thank you.
ChrisOn Fri, 28 Jan 2005 11:54:13 +1100 (EST), Steven Saunders <s_j_nevets at yahoo.com.au> wrote:


Chris Nystrom
http://www.newio.org/~ccn
AIM: nystromchris

Yikes! I finally checked the website and yes indeed, the OS X
framework pacakges for SDL_image and friends seem to be missing. I had
agreed to update all the projects for Xcode, but I haven’t gotten
around to it yet. I thought a release went out, but apparently those
are waiting on me.

That would be great. Could you make an annoucement to the list when
you are able to complete this?

I appreciate it.

ChrisOn Thu, 27 Jan 2005 11:26:41 -0800, E. Wing wrote:

From: Olivier Fabre


Chris Nystrom
http://www.newio.org/~ccn
AIM: nystromchris

Yikes! I finally checked the website and yes indeed, the OS X
framework pacakges for SDL_image and friends seem to be missing. I had
agreed to update all the projects for Xcode, but I haven’t gotten
around to it yet. I thought a release went out, but apparently those
are waiting on me.

That would be great. Could you make an annoucement to the list when
you are able to complete this?

I appreciate it.

I sent Sam all the stuff Monday. Assuming I didn’t mess up anything,
the release is in his hands now.

-Eric

I sent Sam all the stuff Monday. Assuming I didn’t mess up anything,
the release is in his hands now.

I’ve been busy and sick for a while, but I’ll get to this ASAP.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Thank you Sam.

ChrisOn Sat, 12 Feb 2005 10:41:07 -0800, Sam Lantinga wrote:

I sent Sam all the stuff Monday. Assuming I didn’t mess up anything,
the release is in his hands now.

I’ve been busy and sick for a while, but I’ll get to this ASAP.


Chris Nystrom
http://www.newio.org/~ccn
AIM: nystromchris

Hello !

I have coded a Mapeditor for oldskool 2D Games using FLTK
for the GUI stuff and SDL as a blitting and composing engine
for the Levelmaps - and Tiles Display.

On Windows and Linux
it works great. On Mac OS X i have the problem that my two self
written widgets that display the Tiles- and the Map Area
do not get “Mouse Enter the Widget” Area and “Mouse Leaves the Widget
Area” Events.

What does SDL on OS X do when i link and compile it into a programm ?
Does it add any Mac OS X resources or does it other things ?
Does it replace the int main with MacMain or something like that ?

For me this problem is really hard to debug, as
when i link a FLTK example code with SDL it has no problems.

CU