src/video/emscripten/SDL_emscriptenvideo.c
changeset 10331 710c2ae96681
parent 10317 4a45690d5d82
child 10332 359290a75710
     1.1 --- a/src/video/emscripten/SDL_emscriptenvideo.c	Tue Sep 13 00:03:51 2016 -0700
     1.2 +++ b/src/video/emscripten/SDL_emscriptenvideo.c	Tue Sep 13 00:03:53 2016 -0700
     1.3 @@ -47,6 +47,7 @@
     1.4  static void Emscripten_DestroyWindow(_THIS, SDL_Window * window);
     1.5  static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
     1.6  static void Emscripten_PumpEvents(_THIS);
     1.7 +static void Emscripten_SetWindowTitle(_THIS, SDL_Window * window);
     1.8  
     1.9  
    1.10  /* Emscripten driver bootstrap functions */
    1.11 @@ -84,9 +85,9 @@
    1.12      device->PumpEvents = Emscripten_PumpEvents;
    1.13  
    1.14      device->CreateWindow = Emscripten_CreateWindow;
    1.15 -    /*device->CreateWindowFrom = Emscripten_CreateWindowFrom;
    1.16 +    /*device->CreateWindowFrom = Emscripten_CreateWindowFrom;*/
    1.17      device->SetWindowTitle = Emscripten_SetWindowTitle;
    1.18 -    device->SetWindowIcon = Emscripten_SetWindowIcon;
    1.19 +    /*device->SetWindowIcon = Emscripten_SetWindowIcon;
    1.20      device->SetWindowPosition = Emscripten_SetWindowPosition;*/
    1.21      device->SetWindowSize = Emscripten_SetWindowSize;
    1.22      /*device->ShowWindow = Emscripten_ShowWindow;
    1.23 @@ -317,6 +318,16 @@
    1.24      }
    1.25  }
    1.26  
    1.27 +static void
    1.28 +Emscripten_SetWindowTitle(_THIS, SDL_Window * window) {
    1.29 +    EM_ASM_INT({
    1.30 +      if (typeof Module['setWindowTitle'] !== 'undefined') {
    1.31 +        Module['setWindowTitle'](Module['Pointer_stringify']($0));
    1.32 +      }
    1.33 +      return 0;
    1.34 +    }, window->title);
    1.35 +}
    1.36 +
    1.37  #endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */
    1.38  
    1.39  /* vi: set ts=4 sw=4 expandtab: */