comparison src/video/photon/SDL_photon.c @ 3384:04af265172f9

Continue working on 2D support in Photon.
author Mike Gorchak <lestat@i.com.ua>
date Mon, 12 Oct 2009 08:21:43 +0000
parents 90935231e9b6
children fff074de9675
comparison
equal deleted inserted replaced
3383:90935231e9b6 3384:04af265172f9
380 380
381 /* Store device id */ 381 /* Store device id */
382 didata->device_id = it; 382 didata->device_id = it;
383 383
384 /* Query photon about graphics hardware caps and current video mode */ 384 /* Query photon about graphics hardware caps and current video mode */
385 SDL_memset(&hwcaps, 0x00, sizeof(PgHWCaps_t));
385 status = PgGetGraphicsHWCaps(&hwcaps); 386 status = PgGetGraphicsHWCaps(&hwcaps);
386 if (status != 0) { 387 if (status != 0) {
387 PhRect_t extent; 388 PhRect_t extent;
388 PdOffscreenContext_t* curctx; 389 PdOffscreenContext_t* curctx;
389 390
422 if (status != 0) { 423 if (status != 0) {
423 SDL_SetError("Photon: Can't get current video mode information"); 424 SDL_SetError("Photon: Can't get current video mode information");
424 SDL_free(didata->cursor); 425 SDL_free(didata->cursor);
425 SDL_free(didata); 426 SDL_free(didata);
426 return -1; 427 return -1;
428 }
429
430 /* Get current video mode 2D capabilities */
431 didata->mode_2dcaps=0;
432 if ((modeinfo.mode_capabilities2 & PgVM_MODE_CAP2_ALPHA_BLEND)==PgVM_MODE_CAP2_ALPHA_BLEND)
433 {
434 didata->mode_2dcaps|=SDL_VIDEO_CAP_ALPHA_BLEND;
435 }
436 if ((modeinfo.mode_capabilities2 & PgVM_MODE_CAP2_SCALED_BLIT)==PgVM_MODE_CAP2_SCALED_BLIT)
437 {
438 didata->mode_2dcaps|=SDL_VIDEO_CAP_SCALED_BLIT;
427 } 439 }
428 } 440 }
429 441
430 /* Setup current desktop mode for SDL */ 442 /* Setup current desktop mode for SDL */
431 SDL_zero(current_mode); 443 SDL_zero(current_mode);
746 } 758 }
747 759
748 /* Store new video mode parameters */ 760 /* Store new video mode parameters */
749 didata->current_mode = *mode; 761 didata->current_mode = *mode;
750 didata->current_mode.refresh_rate = refresh_rate; 762 didata->current_mode.refresh_rate = refresh_rate;
763
764 /* Get current video mode 2D capabilities */
765 didata->mode_2dcaps=0;
766 if ((modeinfo.mode_capabilities2 & PgVM_MODE_CAP2_ALPHA_BLEND)==PgVM_MODE_CAP2_ALPHA_BLEND)
767 {
768 didata->mode_2dcaps|=SDL_VIDEO_CAP_ALPHA_BLEND;
769 }
770 if ((modeinfo.mode_capabilities2 & PgVM_MODE_CAP2_SCALED_BLIT)==PgVM_MODE_CAP2_SCALED_BLIT)
771 {
772 didata->mode_2dcaps|=SDL_VIDEO_CAP_SCALED_BLIT;
773 }
751 774
752 return 0; 775 return 0;
753 } 776 }
754 777
755 int 778 int