Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added current_w and current_h to SDL_VideoInfo for SDL 1.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 12, 2008
1 parent 98c12c5 commit 196fe95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/SDL_compat.h
Expand Up @@ -88,6 +88,9 @@ typedef struct SDL_VideoInfo
Uint32 video_mem;

SDL_PixelFormat *vfmt;

int current_w;
int current_h;
} SDL_VideoInfo;

/* The most common video overlay formats.
Expand Down
2 changes: 2 additions & 0 deletions src/SDL_compat.c
Expand Up @@ -76,6 +76,8 @@ SDL_GetVideoInfo(void)
SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, &Gmask, &Bmask,
&Amask);
info.vfmt = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
info.current_w = mode.w;
info.current_h = mode.h;
}
return &info;
}
Expand Down
1 change: 1 addition & 0 deletions test/testvidinfo.c
Expand Up @@ -520,6 +520,7 @@ main(int argc, char *argv[])
if (info->blit_fill) {
printf("Color fills on hardware surfaces are accelerated\n");
}
printf("Current resolution: %dx%d\n", info->current_w, info->current_h);
#if 0
if (argv[1] && (strcmp(argv[1], "-benchmark") == 0)) {
RunVideoTests();
Expand Down

0 comments on commit 196fe95

Please sign in to comment.