testvidinfo.c
资源名称:NETVIDEO.rar [点击查看]
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:2k
源码类别:
流媒体/Mpeg4/MP4
开发平台:
Visual C++
- /* Simple program -- figure out what kind of video display we have */
- #include <stdio.h>
- #include <stdlib.h>
- #include "SDL.h"
- int main(int argc, char *argv[])
- {
- const SDL_VideoInfo *info;
- int i;
- SDL_Rect **modes;
- if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
- fprintf(stderr,
- "Couldn't initialize SDL: %sn", SDL_GetError());
- exit(1);
- }
- info = SDL_GetVideoInfo();
- printf(
- "Current display: %d bits-per-pixeln",info->vfmt->BitsPerPixel);
- if ( info->vfmt->palette == NULL ) {
- printf(" Red Mask = 0x%.8xn", info->vfmt->Rmask);
- printf(" Green Mask = 0x%.8xn", info->vfmt->Gmask);
- printf(" Blue Mask = 0x%.8xn", info->vfmt->Bmask);
- }
- /* Print available fullscreen video modes */
- modes = SDL_ListModes(NULL, SDL_FULLSCREEN);
- if ( modes == (SDL_Rect **)0 ) {
- printf("No available fullscreen video modesn");
- } else
- if ( modes == (SDL_Rect **)-1 ) {
- printf("No special fullscreen video modesn");
- } else {
- printf("Fullscreen video modes:n");
- for ( i=0; modes[i]; ++i ) {
- printf("t%dx%dx%dn", modes[i]->w, modes[i]->h, info->vfmt->BitsPerPixel);
- }
- }
- if ( info->wm_available ) {
- printf("A window manager is availablen");
- }
- if ( info->hw_available ) {
- printf("Hardware surfaces are available (%dK video memory)n",
- info->video_mem);
- }
- if ( info->blit_hw ) {
- printf(
- "Copy blits between hardware surfaces are acceleratedn");
- }
- if ( info->blit_hw_CC ) {
- printf(
- "Colorkey blits between hardware surfaces are acceleratedn");
- }
- if ( info->blit_hw_A ) {
- printf(
- "Alpha blits between hardware surfaces are acceleratedn");
- }
- if ( info->blit_sw ) {
- printf(
- "Copy blits from software surfaces to hardware surfaces are acceleratedn");
- }
- if ( info->blit_sw_CC ) {
- printf(
- "Colorkey blits from software surfaces to hardware surfaces are acceleratedn");
- }
- if ( info->blit_sw_A ) {
- printf(
- "Alpha blits from software surfaces to hardware surfaces are acceleratedn");
- }
- if ( info->blit_fill ) {
- printf(
- "Color fills on hardware surfaces are acceleratedn");
- }
- SDL_Quit();
- return(0);
- }