[SDL] How to send a signal to SDL application?
Simon Posnjak
sposnjak at gmail.com
Tue Aug 14 01:32:43 PDT 2007
Why? Because I would like to handle the signal through SDL_event loop
via SDL_SysWMmsg. The way you recommend to do it is not "safe".
Regards Simon
On 8/14/07, Clemens Kirchgatterer <clemens at 1541.org> wrote:
> "Simon Posnjak" <sposnjak at gmail.com> wrote:
>
> > I would like to send the application an signal
> > (SIGUSER1/SIGUSER2) and I would like that SDL would catch them.
>
> huh? why should SDL handle your signals? and what do you want SDL to do
> when it catches it? and how is SDL supposed to know what you want?
>
> i guess you simply want to install a signal handler in your app and
> catch the signal on your own.
>
> man signal
>
> in a nutshell:
>
> #include <unistd.h>
> #include <stdio.h>
> #include <signal.h>
>
> static int running = 1;
>
> static void handler(int sig) {
> printf("got signal %i\n", sig);
> running = 0;
> }
>
> int main() {
> signal(SIGUSR1, handler);
> signal(SIGUSR2, handler);
>
> while (running) usleep(10000);
>
> return (0);
> }
>
> regards ...
> clemens
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
More information about the SDL
mailing list