brewpanel/sdlgui.c

changeset 420
644a6106d712
parent 415
d9b7e0705f56
child 422
13502d0dda65
equal deleted inserted replaced
419:8a7f8272516c 420:644a6106d712
23 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 23 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 *****************************************************************************/ 24 *****************************************************************************/
25 25
26 #include "brewpanel.h" 26 #include "brewpanel.h"
27 #include "sdlgui.h" 27 #include "sdlgui.h"
28 #include "sockio.h"
28 29
29 #ifdef HAVE_SDL_SDL_H 30 #ifdef HAVE_SDL_SDL_H
30 31
31 #include "lcdfont10x16.h" 32 #include "lcdfont10x16.h"
32 33
633 } 634 }
634 } 635 }
635 636
636 /* The main loop */ 637 /* The main loop */
637 while (retbutton == 0 && !my_shutdown) { 638 while (retbutton == 0 && !my_shutdown) {
638 if (SDL_WaitEvent(&sdlEvent) == 1) /* Wait for events */ 639
640 socket_recv();
641
642 if (SDL_PollEvent(&sdlEvent) == 1) { /* Wait for events */
639 switch (sdlEvent.type) { 643 switch (sdlEvent.type) {
640 case SDL_QUIT: 644 case SDL_QUIT:
641 retbutton = SDLGUI_QUIT; 645 retbutton = SDLGUI_QUIT;
642 break; 646 break;
643 647
697 } else if (sdlEvent.key.keysym.sym == SDLK_ESCAPE) { 701 } else if (sdlEvent.key.keysym.sym == SDLK_ESCAPE) {
698 retbutton = SDLGui_SearchFlaggedButton(dlg, SG_CANCEL); 702 retbutton = SDLGui_SearchFlaggedButton(dlg, SG_CANCEL);
699 } 703 }
700 break; 704 break;
701 } 705 }
706 } else {
707 SDL_Delay(1);
708 }
702 } 709 }
703 710
704 if (retbutton == SDLGUI_QUIT) 711 if (retbutton == SDLGUI_QUIT)
705 my_shutdown = TRUE; 712 my_shutdown = TRUE;
706 713

mercurial