comparison src/video/android/SDL_androidvideo.c @ 4981:55b82067815b

Fill in the video mode with the correct screen format
author Sam Lantinga <slouken@libsdl.org>
date Wed, 12 Jan 2011 14:29:01 -0800
parents d9fdff945ec9
children a514bfe6952a
comparison
equal deleted inserted replaced
4980:d9fdff945ec9 4981:55b82067815b
54 extern void Android_GL_DeleteContext(_THIS, SDL_GLContext context); 54 extern void Android_GL_DeleteContext(_THIS, SDL_GLContext context);
55 55
56 /* Android driver bootstrap functions */ 56 /* Android driver bootstrap functions */
57 57
58 58
59 //These are filled in with real values in Android_SetScreenResolution on 59 // These are filled in with real values in Android_SetScreenResolution on
60 //init (before SDL_Main()) 60 // init (before SDL_main())
61 static int iScreenWidth = 320; 61 static Uint32 iScreenFormat = SDL_PIXELFORMAT_UNKNOWN;
62 static int iScreenHeight = 240; 62 static int iScreenWidth = 0;
63 static int iScreenHeight = 0;
63 64
64 65
65 static int 66 static int
66 Android_Available(void) 67 Android_Available(void)
67 { 68 {
120 int 121 int
121 Android_VideoInit(_THIS) 122 Android_VideoInit(_THIS)
122 { 123 {
123 SDL_DisplayMode mode; 124 SDL_DisplayMode mode;
124 125
125 /* Use a fake 32-bpp desktop mode */ 126 mode.format = iScreenFormat;
126 mode.format = SDL_PIXELFORMAT_BGR888;
127 mode.w = iScreenWidth; 127 mode.w = iScreenWidth;
128 mode.h = iScreenHeight; 128 mode.h = iScreenHeight;
129 mode.refresh_rate = 0; 129 mode.refresh_rate = 0;
130 mode.driverdata = NULL; 130 mode.driverdata = NULL;
131 if (SDL_AddBasicVideoDisplay(&mode) < 0) { 131 if (SDL_AddBasicVideoDisplay(&mode) < 0) {
144 void 144 void
145 Android_VideoQuit(_THIS) 145 Android_VideoQuit(_THIS)
146 { 146 {
147 } 147 }
148 148
149 149 void
150 void Android_SetScreenResolution(int width, int height){ 150 Android_SetScreenResolution(int width, int height, Uint32 format)
151 {
151 iScreenWidth = width; 152 iScreenWidth = width;
152 iScreenHeight = height; 153 iScreenHeight = height;
154 iScreenFormat = format;
153 } 155 }
154 156
155
156 /* vi: set ts=4 sw=4 expandtab: */ 157 /* vi: set ts=4 sw=4 expandtab: */