src/video/android/SDL_androidvideo.c
changeset 12693 d311fcb8066a
parent 12625 e58468e48179
child 12823 f7629f5761d8
equal deleted inserted replaced
12692:69f24f4ef99e 12693:d311fcb8066a
    24 
    24 
    25 /* Android SDL video driver implementation */
    25 /* Android SDL video driver implementation */
    26 
    26 
    27 #include "SDL_video.h"
    27 #include "SDL_video.h"
    28 #include "SDL_mouse.h"
    28 #include "SDL_mouse.h"
       
    29 #include "SDL_hints.h"
    29 #include "../SDL_sysvideo.h"
    30 #include "../SDL_sysvideo.h"
    30 #include "../SDL_pixels_c.h"
    31 #include "../SDL_pixels_c.h"
    31 #include "../../events/SDL_events_c.h"
    32 #include "../../events/SDL_events_c.h"
    32 #include "../../events/SDL_windowevents_c.h"
    33 #include "../../events/SDL_windowevents_c.h"
    33 
    34 
    91 static SDL_VideoDevice *
    92 static SDL_VideoDevice *
    92 Android_CreateDevice(int devindex)
    93 Android_CreateDevice(int devindex)
    93 {
    94 {
    94     SDL_VideoDevice *device;
    95     SDL_VideoDevice *device;
    95     SDL_VideoData *data;
    96     SDL_VideoData *data;
       
    97     SDL_bool block_on_pause;
    96 
    98 
    97     /* Initialize all variables that we clean on shutdown */
    99     /* Initialize all variables that we clean on shutdown */
    98     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
   100     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    99     if (!device) {
   101     if (!device) {
   100         SDL_OutOfMemory();
   102         SDL_OutOfMemory();
   111     device->driverdata = data;
   113     device->driverdata = data;
   112 
   114 
   113     /* Set the function pointers */
   115     /* Set the function pointers */
   114     device->VideoInit = Android_VideoInit;
   116     device->VideoInit = Android_VideoInit;
   115     device->VideoQuit = Android_VideoQuit;
   117     device->VideoQuit = Android_VideoQuit;
   116     device->PumpEvents = Android_PumpEvents;
   118     block_on_pause = SDL_GetHintBoolean(SDL_HINT_ANDROID_BLOCK_ON_PAUSE, SDL_TRUE);
       
   119     if (block_on_pause) {
       
   120         device->PumpEvents = Android_PumpEvents_Blocking;
       
   121     } else {
       
   122         device->PumpEvents = Android_PumpEvents_NonBlocking;
       
   123     }
   117 
   124 
   118     device->GetDisplayDPI = Android_GetDisplayDPI;
   125     device->GetDisplayDPI = Android_GetDisplayDPI;
   119 
   126 
   120     device->CreateSDLWindow = Android_CreateWindow;
   127     device->CreateSDLWindow = Android_CreateWindow;
   121     device->SetWindowTitle = Android_SetWindowTitle;
   128     device->SetWindowTitle = Android_SetWindowTitle;