src/render/SDL_render.c
changeset 12910 dd9169424181
parent 12909 8e27bc5f03d8
child 13019 ecad0a0684ad
equal deleted inserted replaced
12909:8e27bc5f03d8 12910:dd9169424181
    27 #include "SDL_log.h"
    27 #include "SDL_log.h"
    28 #include "SDL_render.h"
    28 #include "SDL_render.h"
    29 #include "SDL_sysrender.h"
    29 #include "SDL_sysrender.h"
    30 #include "software/SDL_render_sw_c.h"
    30 #include "software/SDL_render_sw_c.h"
    31 
    31 
       
    32 #if defined(__ANDROID__)
       
    33 #  include "../core/android/SDL_android.h"
       
    34 #endif
    32 
    35 
    33 #define SDL_WINDOWRENDERDATA    "_SDL_WindowRenderData"
    36 #define SDL_WINDOWRENDERDATA    "_SDL_WindowRenderData"
    34 
    37 
    35 #define CHECK_RENDERER_MAGIC(renderer, retval) \
    38 #define CHECK_RENDERER_MAGIC(renderer, retval) \
    36     SDL_assert(renderer && renderer->magic == &renderer_magic); \
    39     SDL_assert(renderer && renderer->magic == &renderer_magic); \
   835     SDL_Renderer *renderer = NULL;
   838     SDL_Renderer *renderer = NULL;
   836     int n = SDL_GetNumRenderDrivers();
   839     int n = SDL_GetNumRenderDrivers();
   837     SDL_bool batching = SDL_TRUE;
   840     SDL_bool batching = SDL_TRUE;
   838     const char *hint;
   841     const char *hint;
   839 
   842 
       
   843 #if defined(__ANDROID__)
       
   844     Android_ActivityMutex_Lock_Running();
       
   845 #endif
       
   846 
   840     if (!window) {
   847     if (!window) {
   841         SDL_SetError("Invalid window");
   848         SDL_SetError("Invalid window");
   842         goto error;
   849         goto error;
   843     }
   850     }
   844 
   851 
   949     SDL_AddEventWatch(SDL_RendererEventWatch, renderer);
   956     SDL_AddEventWatch(SDL_RendererEventWatch, renderer);
   950 
   957 
   951     SDL_LogInfo(SDL_LOG_CATEGORY_RENDER,
   958     SDL_LogInfo(SDL_LOG_CATEGORY_RENDER,
   952                 "Created renderer: %s", renderer->info.name);
   959                 "Created renderer: %s", renderer->info.name);
   953 
   960 
       
   961 #if defined(__ANDROID__)
       
   962     Android_ActivityMutex_Unlock();
       
   963 #endif
   954     return renderer;
   964     return renderer;
   955 
   965 
   956 error:
   966 error:
       
   967 
       
   968 #if defined(__ANDROID__)
       
   969     Android_ActivityMutex_Unlock();
       
   970 #endif
   957     return NULL;
   971     return NULL;
   958 
   972 
   959 #else
   973 #else
   960     SDL_SetError("SDL not built with rendering support");
   974     SDL_SetError("SDL not built with rendering support");
   961     return NULL;
   975     return NULL;