   SDL without a window
  Is it possible to have an SDL program running without a window?I tried it, but if I don't ever call "SDL_SetVideoMode", then the program crashes if for example I try to use keyboard input or events.1) Is there a way to use realtime keyboard input, events and audio without creating any window (i.e. console only)?2) If I do SDL_Init(SDL_INIT_VIDEO), how comes it that audio, the timer, keyboard and such work too? Because the sdl reference (http://docs.mandragor.org/files/Common_libs_documentation/SDL/SDL_Documentation_project_en/sdlinit.html) says that for those things you'd also have to add the flags SDL_INIT_TIMER and SDL_INIT_AUDIO to initialize those. They appear to work without however, because I never really looked back at it and have always been working simply with SDL_Init(SDL_INIT_VIDEO) and everything else worked too.   
  AFAIK you need to have a window in order to be able to use keyboard events as those events come from the window.SDL_GetTicks and such always worked for me without usign SDL_INIT_TIMER but I think SDL_INIT_TIMER initialized some other timer subsystem. I don't know why audio works without SDL_INIT_AUDIO, but you should still use SDL_INIT_AUDIO if you use audio since it might not work on another platform without it.   ;Quote:Original post by Lode2) If I do SDL_Init(SDL_INIT_VIDEO), how comes it that audio, the timer, keyboard and such work too? Because the sdl reference says that for those things you'd also have to add the flags SDL_INIT_TIMER and SDL_INIT_AUDIO to initialize those. They appear to work without however, because I never really looked back at it and have always been working simply with SDL_Init(SDL_INIT_VIDEO) and everything else worked too.The results of using the functions without initializing the subsystems are undefined; the worst thing about undefined behavior is that it sometimes tends to work. You should consider passing in SDL_INIT_EVERYTHING if you don't want to bother OR'ing together all the flags you need.I'm pretty sure you're not going to be able to use any of the video functions without creating a window, simply because as you pointed out, you need to call SDL_SetVideoMode before you can work with the surfaces. I'm not sure if there is a workaround for this, but I think it's probably worth re-evaluating your needs and using a different library, depending on what you were looking to do with SDL.   ;  In SDL, the application itself takes the focus from the OS regardless of whether you have a display surface initialized. So, its possible to have an application running without a display. However, you can forget about trapping mouse events, because AFAIK those are dependent on a display surface. You can, however, use most of the rest of SDL. I used this functionality to make a joke application for my brother, which opens and closes his cd trays. Didnt bother to initialize an SDL_Surface.Disclaimer: I've not used SDL on every platform. It behaves this way on Linux and OS X.Does your application actually crash if you try to get KB input?;  Just use something like one of the tiny font libraries and do everything in a graphical window.   ;  If you set the environment variable SDL_VIDEODRIVER to the value "dummy" before intializing a video mode (or before SDL init?) the dummy video driver will be used and SDL_SetVideoMode will not create a window but you will still be able to use the functions that normally would require a window. Whether events will work or not I don't know.   