[SDL] Strange problem with Win32 Sleep function and SDL

Patricia Curtis patricia.curtis at gmail.com
Wed Jun 6 05:27:03 PDT 2007


>
> Message: 1
> Date: Wed, 6 Jun 2007 00:33:19 +0000 (UTC)
> From: voidstar <voidstar at tin.it>
> Subject: [SDL] Strange problem with Win32 Sleep function and SDL
> To: sdl at libsdl.org
> Message-ID: <loom.20070606T022959-683 at post.gmane.org>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hello, in my program I have this line:
>
> Sleep(3000);
>
> //First, I noticed that during the sleep-time I can still
> //move the mouse and I see my cursor moving on the screen
> //(but the rest of the program is "stopped"). Why?
>
> //Apart from that, my problem is that if during the sleep-time
> //I click a mouse button, at the end of the sleep-time my
> //program enters in this case of the switch:
>
> while (SDL_PollEvent(&event)) {
>        switch (event.type)
>        ....
>        ....
>        case SDL_QUIT:
>                return(0);
>        ...
>
> And the program stops the execution.
>
> //Is this normal? Why the event is now "SDL_QUIT"?
> //Is there a way to solve this problem?
> //Sorry but I'm new with SDL ;-)



Have you forgotten to put break; before after the other cases, ie the wake
up event? you show the case SDL_QUIT, but it looks like you may have a
problem before the Quit Case, ie no break;

Just a thought!

T

>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070606/31af830c/attachment.htm 


More information about the SDL mailing list