SDL_StartEventLoop

Name

SDL_StartEventLoop -- Initialize the event subsystem.

Synopsis

#include "SDL.h"

int SDL_StartEventLoop (Uint32 flags);

Description

SDL_StartEventLoop initializes the event subsystem.

Parameters

Return Value

Returns 0 if successful, otherwise returns -1.

Note: This function (and associated calls) may be called more than once.

Note: This function is called only from SDL_VideoInit.

Example

   1     /* Toggle the event thread flags, based on OS requirements */
   2 #if defined(MUST_THREAD_EVENTS)
   3     flags |= SDL_INIT_EVENTTHREAD;
   4 #elif defined(CANT_THREAD_EVENTS)
   5     if ((flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD) {
   6         SDL_SetError("OS doesn't support threaded events");
   7         return -1;
   8     }
   9 #endif
  10 
  11     /* Start the event loop */
  12     if (SDL_StartEventLoop(flags) < 0) {
  13         return -1;
  14     }

See Also

SDL_VideoInit, SDL_StopEventLoop


CategorySDL13Internal CategorySDL13InternalEvent

SDL-1.3/SDL_StartEventLoop (last edited 2009-07-27 05:10:11 by KenBull)