Is there statlc sdl lib for VC++?

Hello,

I know there is dynamic sdl dll for VC++ and it works well. My question is :Is there statlc sdl lib for VC++?

Best Regards,
Xie Bo

IANAL, but not without breaking the LGPL license I believe. You can
build such a static link library, and link your program to it, but if
you distribute it to others you must include the source code for your
program. Of course, if you have no plans distributing your programs
this is not a problem.

Short answer: no.

/OlofOn Wed, 16 Mar 2005 17:42:56 +0800, Xie Bo wrote:

Hello,

I know there is dynamic sdl dll for VC++ and it works well. My question

is :Is there statlc sdl lib for VC++?

Best Regards,
Xie Bo


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

IANAL either, but I think the licence states rather clearly that you
only need to distribute the object files, or otherwise make sure
users can relink your application with other versions of the LGPLed
library.

It’s the GPL that requires that you distribute the source - and that’s
regardless of how you’re linking.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Wednesday 16 March 2005 12.21, Olof Bjarnason wrote:

IANAL, but not without breaking the LGPL license I believe. You can
build such a static link library, and link your program to it, but
if you distribute it to others you must include the source code for
your program.

Hi

I am writing a looping program that calls up a new video (mpegs) to an SDL
surface upon each iteration of the loop I am currently just testing it, and I
cant find a good way to cleanly quit out of the video and the program.

If I try to use Ctrl+C while the video is playing it just freezes up. Can
someone please recommend a good way to close the mpeg, clean up the surface and
free up the memory?

Thanks
//Sh

IANAL either, but I think the licence states rather clearly that you
only need to distribute the object files, or otherwise make sure
users can relink your application with other versions of the LGPLed
library.
Ok, that’s better …

/Olof>

It’s the GPL that requires that you distribute the source - and that’s
regardless of how you’re linking.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

You need to catch the CTRL+C signal, so it doesn’t just try to abort
your application without cleaning up.

You can use signal() from signal.h to wire signals to callback
functions - but DO NOT try to clean up and exit from whithin the
context of such a callback! That will most definitely cause all h*ll
to break lose, regardless of platform. Just set a flag, post an SDL
event or something, and have the main loop respond to that by
cleaning up and exiting.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Wednesday 16 March 2005 15.07, shu wrote:

Hi

I am writing a looping program that calls up a new video (mpegs) to
an SDL surface upon each iteration of the loop I am currently just
testing it, and I cant find a good way to cleanly quit out of the
video and the program.

If I try to use Ctrl+C while the video is playing it just freezes
up. Can someone please recommend a good way to close the mpeg,
clean up the surface and free up the memory?

Maybe this is a dumb question: but would it be acceptable for your
program to listen for keyboard input?On Mar 16, 2005, at 9:07 AM, shu wrote:

Hi

I am writing a looping program that calls up a new video (mpegs) to an
SDL
surface upon each iteration of the loop I am currently just testing
it, and I
cant find a good way to cleanly quit out of the video and the program.

If I try to use Ctrl+C while the video is playing it just freezes up.
Can
someone please recommend a good way to close the mpeg, clean up the
surface and
free up the memory?

Thanks
//Sh


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

David Olofson wrote:>On Wednesday 16 March 2005 15.07, shu wrote:

Hi

I am writing a looping program that calls up a new video (mpegs) to
an SDL surface upon each iteration of the loop I am currently just
testing it, and I cant find a good way to cleanly quit out of the
video and the program.

If I try to use Ctrl+C while the video is playing it just freezes
up. Can someone please recommend a good way to close the mpeg,
clean up the surface and free up the memory?

You need to catch the CTRL+C signal, so it doesn’t just try to abort
your application without cleaning up.

You can use signal() from signal.h to wire signals to callback
functions - but DO NOT try to clean up and exit from whithin the
context of such a callback! That will most definitely cause all h*ll
to break lose, regardless of platform. Just set a flag, post an SDL
event or something, and have the main loop respond to that by
cleaning up and exiting.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

This worked nicely. I used the signal name SIGINT and a signal handler
function and did all the cleaning up of SDL and SMPEG inside there.

Thanks!

[…]

This worked nicely. I used the signal name SIGINT and a signal
handler function and did all the cleaning up of SDL and SMPEG inside
there.

From inside the handler? :slight_smile:

Well, that may work “most of the time” on some platforms, but the
problem is that a signal handler essentially runs in a parallel
thread. (Actually, it’s even worse on some platforms; the signal
handlers may not even run in proper thread contexts.)

The result is that Very Bad Things™ are likely to happen,
especially when dealing with a non thread safe library like SDL. Hit
CTRL+C at the wrong moment and boom… When that happens, a simple
abort() would have been cleaner and safer. :slight_smile:

Just setting a “volatile int” flag that makes the main loop close
should be safe. (Doesn’t even matter if accessing the flag is atomic
in this trivial case. No sync needed.)

Of course, you’ll have to wait up to one frame (provided the main loop
checks the flag once per frame), and it won’t work if the main loop
is stuck.

To deal with the latter in Kobo Deluxe, I have the signal handler
check the flag, and if it’s already set (that is, second try), the
handler assumes the main loop is dead and tries a more brutal
approach to closing down. The brutal method has some probability of
crasching, but at least there’s a chance of getting out without
leaving X locked in whatever resolution the game was using. “Most of
the time” is better than “never”.

However, “always” is better than “most of the time” - so at least try
to have the main loop do the cleaning up first, before stomping all
over the place. :slight_smile:

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Friday 18 March 2005 01.49, Sue H wrote:

If I try to use Ctrl+C while the video is playing it just freezes
up. Can someone please recommend a good way to close the mpeg,
clean up the surface and free up the memory?

You need to catch the CTRL+C signal, so it doesn’t just try to abort
your application without cleaning up.

Actually, SDL by default sets a handler for SIGINT that sends an SDL_QUIT
message. I wonder why that isn’t working?

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