Mercurial > sdl-ios-xcode
comparison src/SDL_compat.c @ 3280:00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 19 Sep 2009 13:29:40 +0000 |
parents | 7f684f249ec9 |
children | 4b594623401b |
comparison
equal
deleted
inserted
replaced
3279:fd207dce9f94 | 3280:00cace2d9080 |
---|---|
38 static SDL_Surface *SDL_PublicSurface = NULL; | 38 static SDL_Surface *SDL_PublicSurface = NULL; |
39 static SDL_GLContext *SDL_VideoContext = NULL; | 39 static SDL_GLContext *SDL_VideoContext = NULL; |
40 static Uint32 SDL_VideoFlags = 0; | 40 static Uint32 SDL_VideoFlags = 0; |
41 static char *wm_title = NULL; | 41 static char *wm_title = NULL; |
42 static SDL_Surface *SDL_VideoIcon; | 42 static SDL_Surface *SDL_VideoIcon; |
43 static int SDL_enabled_UNICODE = 0; | |
43 | 44 |
44 char * | 45 char * |
45 SDL_AudioDriverName(char *namebuf, int maxlen) | 46 SDL_AudioDriverName(char *namebuf, int maxlen) |
46 { | 47 { |
47 const char *name = SDL_GetCurrentAudioDriver(); | 48 const char *name = SDL_GetCurrentAudioDriver(); |
1718 } | 1719 } |
1719 | 1720 |
1720 int | 1721 int |
1721 SDL_EnableUNICODE(int enable) | 1722 SDL_EnableUNICODE(int enable) |
1722 { | 1723 { |
1723 return SDL_EventState(SDL_TEXTINPUT, enable); | 1724 int previous = SDL_enabled_UNICODE; |
1725 | |
1726 switch (enable) { | |
1727 case 1: | |
1728 SDL_enabled_UNICODE = 1; | |
1729 SDL_StartTextInput(); | |
1730 break; | |
1731 case 0: | |
1732 SDL_enabled_UNICODE = 0; | |
1733 SDL_StopTextInput(); | |
1734 break; | |
1735 } | |
1736 return previous; | |
1724 } | 1737 } |
1725 | 1738 |
1726 /* vi: set ts=4 sw=4 expandtab: */ | 1739 /* vi: set ts=4 sw=4 expandtab: */ |