Mercurial > sdl-ios-xcode
comparison src/video/photon/SDL_photon.c @ 3186:51750b7a966f
indent
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 10 Jun 2009 13:34:20 +0000 |
parents | 44d5474c2c8a |
children | 64e4442676a6 |
comparison
equal
deleted
inserted
replaced
3185:44d5474c2c8a | 3186:51750b7a966f |
---|---|
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 status = PgGetGraphicsHWCaps(&hwcaps); | 385 status = PgGetGraphicsHWCaps(&hwcaps); |
386 if (status != 0) { | 386 if (status != 0) { |
387 PhRect_t extent; | 387 PhRect_t extent; |
388 PdOffscreenContext_t* curctx; | 388 PdOffscreenContext_t *curctx; |
389 | 389 |
390 /* If error happens, this also could mean, that photon is working */ | 390 /* If error happens, this also could mean, that photon is working */ |
391 /* under custom (not listed by photon) video mode */ | 391 /* under custom (not listed by photon) video mode */ |
392 status=PhWindowQueryVisible(Ph_QUERY_GRAPHICS, 0, 0, &extent); | 392 status = PhWindowQueryVisible(Ph_QUERY_GRAPHICS, 0, 0, &extent); |
393 if (status != 0) { | 393 if (status != 0) { |
394 SDL_SetError("Photon: Can't get graphics driver region"); | 394 SDL_SetError("Photon: Can't get graphics driver region"); |
395 SDL_free(didata->cursor); | 395 SDL_free(didata->cursor); |
396 SDL_free(didata); | 396 SDL_free(didata); |
397 return -1; | 397 return -1; |
398 } | 398 } |
399 modeinfo.width=extent.lr.x+1; | 399 modeinfo.width = extent.lr.x + 1; |
400 modeinfo.height=extent.lr.y+1; | 400 modeinfo.height = extent.lr.y + 1; |
401 /* Hardcode 60Hz, as the base refresh rate frequency */ | 401 /* Hardcode 60Hz, as the base refresh rate frequency */ |
402 hwcaps.current_rrate=60; | 402 hwcaps.current_rrate = 60; |
403 /* Clear current video driver name, no way to get it somehow */ | 403 /* Clear current video driver name, no way to get it somehow */ |
404 hwcaps.chip_name[0]=0x00; | 404 hwcaps.chip_name[0] = 0x00; |
405 | 405 |
406 /* Create offscreen context from video memory, which is currently */ | 406 /* Create offscreen context from video memory, which is currently */ |
407 /* displayed on the screen */ | 407 /* displayed on the screen */ |
408 curctx=PdCreateOffscreenContext(0, 0, 0, Pg_OSC_MAIN_DISPLAY); | 408 curctx = PdCreateOffscreenContext(0, 0, 0, Pg_OSC_MAIN_DISPLAY); |
409 if (curctx==NULL) | 409 if (curctx == NULL) { |
410 { | |
411 SDL_SetError("Photon: Can't get display area capabilities"); | 410 SDL_SetError("Photon: Can't get display area capabilities"); |
412 SDL_free(didata->cursor); | 411 SDL_free(didata->cursor); |
413 SDL_free(didata); | 412 SDL_free(didata); |
414 return -1; | 413 return -1; |
415 } | 414 } |
416 /* Retrieve current bpp */ | 415 /* Retrieve current bpp */ |
417 modeinfo.type=curctx->format; | 416 modeinfo.type = curctx->format; |
418 PhDCRelease(curctx); | 417 PhDCRelease(curctx); |
419 } else { | 418 } else { |
420 /* Get current video mode details */ | 419 /* Get current video mode details */ |
421 status = PgGetVideoModeInfo(hwcaps.current_video_mode, &modeinfo); | 420 status = PgGetVideoModeInfo(hwcaps.current_video_mode, &modeinfo); |
422 if (status != 0) { | 421 if (status != 0) { |
423 SDL_SetError("Photon: Can't get current video mode information"); | 422 SDL_SetError |
423 ("Photon: Can't get current video mode information"); | |
424 SDL_free(didata->cursor); | 424 SDL_free(didata->cursor); |
425 SDL_free(didata); | 425 SDL_free(didata); |
426 return -1; | 426 return -1; |
427 } | 427 } |
428 } | 428 } |