src/video/android/SDL_androidvideo.c
changeset 4716 f2c2a33a1a38
parent 4713 ba38983b10c2
child 4960 0ab2492f2e17
equal deleted inserted replaced
4715:9bb98766eed0 4716:f2c2a33a1a38
    53 extern int Android_GL_GetSwapInterval(_THIS);
    53 extern int Android_GL_GetSwapInterval(_THIS);
    54 extern void Android_GL_SwapWindow(_THIS, SDL_Window * window);
    54 extern void Android_GL_SwapWindow(_THIS, SDL_Window * window);
    55 extern void Android_GL_DeleteContext(_THIS, SDL_GLContext context);
    55 extern void Android_GL_DeleteContext(_THIS, SDL_GLContext context);
    56 
    56 
    57 /* Android driver bootstrap functions */
    57 /* Android driver bootstrap functions */
       
    58 
       
    59 
       
    60 //These are filled in with real values in Android_SetScreenResolution on 
       
    61 //init (before SDL_Main())
       
    62 static int iScreenWidth = 320;
       
    63 static int iScreenHeight = 240;
    58 
    64 
    59 
    65 
    60 static int
    66 static int
    61 Android_Available(void)
    67 Android_Available(void)
    62 {
    68 {
   118 {
   124 {
   119     SDL_DisplayMode mode;
   125     SDL_DisplayMode mode;
   120 
   126 
   121     /* Use a fake 32-bpp desktop mode */
   127     /* Use a fake 32-bpp desktop mode */
   122     mode.format = SDL_PIXELFORMAT_RGB888;
   128     mode.format = SDL_PIXELFORMAT_RGB888;
   123     mode.w = 320;
   129     mode.w = iScreenWidth;
   124     mode.h = 480;
   130     mode.h = iScreenHeight;
   125     mode.refresh_rate = 0;
   131     mode.refresh_rate = 0;
   126     mode.driverdata = NULL;
   132     mode.driverdata = NULL;
   127     if (SDL_AddBasicVideoDisplay(&mode) < 0) {
   133     if (SDL_AddBasicVideoDisplay(&mode) < 0) {
   128         return -1;
   134         return -1;
   129     }
   135     }
   148 Android_VideoQuit(_THIS)
   154 Android_VideoQuit(_THIS)
   149 {
   155 {
   150 }
   156 }
   151 
   157 
   152 
   158 
       
   159 void Android_SetScreenResolution(int width, int height){
       
   160     iScreenWidth = width;
       
   161     iScreenHeight = height;   
       
   162 }
       
   163 
       
   164 
   153 
   165 
   154 /* vi: set ts=4 sw=4 expandtab: */
   166 /* vi: set ts=4 sw=4 expandtab: */