Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_gdirender.c @ 4569:e1664f94f026
Andrey A.
I made a video driver GAPI/RAW for WinCE (SDL-1.3).
RAW mode has a priority, and also, GAPI mode works with environment
"SDL_VIDEO_RENDERER=gapi" and for RAW mode "SDL_VIDEO_RENDERER=raw".
I checked the work on the screens of VGA, WVGA, QVGA, WQVGA, HVGA,
+ tested all modes with WindowsMobile Emulator.
Also, correctly draws the pointer position and the scale of the pointer
for VGA/WVGA modes,
correctly draws top left position for DM orientation screen, and
portrait/landscape/square geometry the screen also correct.
Also, I added a small fix for GDI fullscreen mode.
Patch for latest revision SDL-1.3 in an attachment.
Also added small path for mingw32ce build.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 27 Jul 2010 21:31:28 -0700 |
parents | f7b03b6838cb |
children | aa8888658021 |
comparison
equal
deleted
inserted
replaced
4568:25b9cd8bdc30 | 4569:e1664f94f026 |
---|---|
182 GDI_DestroyRenderer(renderer); | 182 GDI_DestroyRenderer(renderer); |
183 SDL_OutOfMemory(); | 183 SDL_OutOfMemory(); |
184 return NULL; | 184 return NULL; |
185 } | 185 } |
186 | 186 |
187 windowdata->videodata->render = RENDER_GDI; | |
188 | |
187 renderer->DisplayModeChanged = GDI_DisplayModeChanged; | 189 renderer->DisplayModeChanged = GDI_DisplayModeChanged; |
188 renderer->CreateTexture = GDI_CreateTexture; | 190 renderer->CreateTexture = GDI_CreateTexture; |
189 renderer->QueryTexturePixels = GDI_QueryTexturePixels; | 191 renderer->QueryTexturePixels = GDI_QueryTexturePixels; |
190 renderer->SetTexturePalette = GDI_SetTexturePalette; | 192 renderer->SetTexturePalette = GDI_SetTexturePalette; |
191 renderer->GetTexturePalette = GDI_GetTexturePalette; | 193 renderer->GetTexturePalette = GDI_GetTexturePalette; |
265 data->current_hdc = data->window_hdc; | 267 data->current_hdc = data->window_hdc; |
266 data->makedirty = SDL_FALSE; | 268 data->makedirty = SDL_FALSE; |
267 } | 269 } |
268 data->current_hbm = 0; | 270 data->current_hbm = 0; |
269 | 271 |
272 #ifdef _WIN32_WCE | |
273 // check size for GDI fullscreen and rotate | |
274 if((window->flags & SDL_WINDOW_FULLSCREEN) && | |
275 GetSystemMetrics(SM_CXSCREEN) != GetSystemMetrics(SM_CYSCREEN) && | |
276 ((GetSystemMetrics(SM_CXSCREEN) < GetSystemMetrics(SM_CYSCREEN) && window->w > window->h) || | |
277 (GetSystemMetrics(SM_CXSCREEN) > GetSystemMetrics(SM_CYSCREEN) && window->w < window->h))) | |
278 { | |
279 int orientation = WINCE_GetDMOrientation(); | |
280 switch(orientation) | |
281 { | |
282 case DMDO_0: orientation = DMDO_90; break; | |
283 case DMDO_270: orientation = DMDO_180; break; | |
284 case DMDO_90: orientation = DMDO_0; break; | |
285 case DMDO_180: orientation = DMDO_270; break; | |
286 | |
287 default: | |
288 GDI_DestroyRenderer(renderer); | |
289 return NULL; | |
290 } | |
291 | |
292 if(0 > WINCE_SetDMOrientation(orientation)) | |
293 { | |
294 GDI_DestroyRenderer(renderer); | |
295 return NULL; | |
296 } | |
297 } | |
298 #endif | |
299 | |
270 return renderer; | 300 return renderer; |
271 } | 301 } |
272 | 302 |
273 static int | 303 static int |
274 GDI_DisplayModeChanged(SDL_Renderer * renderer) | 304 GDI_DisplayModeChanged(SDL_Renderer * renderer) |
414 } | 444 } |
415 if (!data->hbm) { | 445 if (!data->hbm) { |
416 WIN_SetError("Couldn't create bitmap"); | 446 WIN_SetError("Couldn't create bitmap"); |
417 return -1; | 447 return -1; |
418 } | 448 } |
449 | |
419 return 0; | 450 return 0; |
420 } | 451 } |
421 | 452 |
422 static int | 453 static int |
423 GDI_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, | 454 GDI_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, |