src/SDL12_compat.c
changeset 60 76cf0dc4bce4
parent 59 39067b54d1b0
child 61 832594ced260
equal deleted inserted replaced
59:39067b54d1b0 60:76cf0dc4bce4
   532 {
   532 {
   533     static const SDL_version version = { 1, 2, SDL12_COMPAT_VERSION };
   533     static const SDL_version version = { 1, 2, SDL12_COMPAT_VERSION };
   534     return &version;
   534     return &version;
   535 }
   535 }
   536 
   536 
       
   537 DECLSPEC int SDLCALL
       
   538 SDL_sscanf(const char *text, const char *fmt, ...)
       
   539 {
       
   540     int retval;
       
   541     va_list ap;
       
   542     va_start(ap, fmt);
       
   543     retval = (int) SDL20_sscanf(text, fmt, ap);
       
   544     va_end(ap);
       
   545     return retval;
       
   546 }
       
   547 
       
   548 DECLSPEC int SDLCALL
       
   549 SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...)
       
   550 {
       
   551     int retval;
       
   552     va_list ap;
       
   553     va_start(ap, fmt);
       
   554     retval = (int) SDL20_vsnprintf(text, maxlen, fmt, ap);
       
   555     va_end(ap);
       
   556     return retval;
       
   557 }
       
   558 
       
   559 DECLSPEC SDL_bool SDLCALL
       
   560 SDL_HasMMXExt(void)
       
   561 {
       
   562     /* this isn't accurate, but SDL2 doesn't have this for some reason.
       
   563         MMXExt is available in all SSE1 machines, except early Athlon chips,
       
   564         so we'll just say it's available if they have SSE1. Oh well. */
       
   565     return SDL20_HasSSE();
       
   566 }
       
   567 
       
   568 DECLSPEC SDL_bool SDLCALL
       
   569 SDL_Has3DNowExt(void)
       
   570 {
       
   571     FIXME("check this");
       
   572     return SDL20_HasSSE();
       
   573 }
       
   574 
       
   575 DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index)
       
   576 {
       
   577     FIXME("write me");
       
   578     return 0;
       
   579 }
       
   580 
   537 static int
   581 static int
   538 GetVideoDisplay()
   582 GetVideoDisplay()
   539 {
   583 {
   540     FIXME("cache this value during SDL_Init() so it doesn't change.");
   584     FIXME("cache this value during SDL_Init() so it doesn't change.");
   541     const char *variable = SDL20_getenv("SDL_VIDEO_FULLSCREEN_DISPLAY");
   585     const char *variable = SDL20_getenv("SDL_VIDEO_FULLSCREEN_DISPLAY");
   834 }
   878 }
   835 
   879 
   836 DECLSPEC const char * SDLCALL
   880 DECLSPEC const char * SDLCALL
   837 SDL_GetError(void)
   881 SDL_GetError(void)
   838 {
   882 {
   839     if (!Loaded_SDL20)
   883     if (SDL20_GetError == NULL)
   840     {
   884     {
   841         static const char noload_errstr[] = "Failed to load SDL 2.0 shared library";
   885         static const char noload_errstr[] = "The SDL 2.0 library that the 1.2 compatibility layer needs isn't loaded";
   842         return noload_errstr;
   886         return noload_errstr;
   843     }
   887     }
   844     return SDL20_GetError();
   888     return SDL20_GetError();
   845 }
   889 }
   846 
   890