Add support for the color palette functions.

Adds emulation for:
- SDL_SetPalette
- SDL_SetColors
Based on the SDL_compat code.
Add initial event emulation.

Based on the code in SDL_compat.
Allow renderer flags to be set.

This change allows SDL_SetVideoMode to set the SDL_HWSURFACE flag when
creating the renderer.
Enable the compatibility event filter.

The idea was from SDL_compat, but this version allows the user to
disabling the adding of the filter if wanted.
Add emulation for SDL_GetAppState.

Based on code in SDL_compat.