annotate test/testvidinfo.c @ 483:32190cba6c40

*** empty log message ***
author Sam Lantinga <slouken@libsdl.org>
date Sun, 01 Sep 2002 00:40:12 +0000
parents 6417071ba2e5
children 1b8ea19e9ee4
rev   line source
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2 /* Simple program -- figure out what kind of video display we have */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
4 #include <stdlib.h>
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5 #include <stdio.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6 #include <stdlib.h>
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
7
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
8 #include "SDL.h"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
9
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
10 #define NUM_BLITS 10
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
11 #define NUM_UPDATES 500
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
12
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
13 #define FLAG_MASK (SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF)
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
14
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
15 void PrintFlags(Uint32 flags)
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
16 {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
17 printf("0x%8.8x", (flags & FLAG_MASK));
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
18 if ( flags & SDL_HWSURFACE ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
19 printf(" SDL_HWSURFACE");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
20 } else {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
21 printf(" SDL_SWSURFACE");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
22 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
23 if ( flags & SDL_FULLSCREEN ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
24 printf(" | SDL_FULLSCREEN");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
25 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
26 if ( flags & SDL_DOUBLEBUF ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
27 printf(" | SDL_DOUBLEBUF");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
28 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
29 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
30
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
31 int RunBlitTests(SDL_Surface *screen, SDL_Surface *bmp, int blitcount)
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
32 {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
33 int i, j;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
34 int maxx;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
35 int maxy;
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
36 SDL_Rect dst;
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
37
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
38 maxx = (int)screen->w - bmp->w + 1;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
39 maxy = (int)screen->h - bmp->h + 1;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
40 for ( i = 0; i < NUM_UPDATES; ++i ) {
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
41 for ( j = 0; j < blitcount; ++j ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
42 if ( maxx ) {
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
43 dst.x = rand() % maxx;
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
44 } else {
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
45 dst.x = 0;
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
46 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
47 if ( maxy ) {
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
48 dst.y = rand() % maxy;
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
49 } else {
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
50 dst.y = 0;
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
51 }
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
52 dst.w = bmp->w;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
53 dst.h = bmp->h;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
54 SDL_BlitSurface(bmp, NULL, screen, &dst);
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
55 }
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
56 SDL_Flip(screen);
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
57 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
58
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
59 return i;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
60 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
61
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
62 int RunModeTests(SDL_Surface *screen)
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
63 {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
64 Uint32 then, now;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
65 Uint32 frames;
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
66 float seconds;
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
67 int i;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
68 Uint8 r, g, b;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
69 SDL_Surface *bmp, *tmp;
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
70 SDL_Event event;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
71
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
72 while ( SDL_PollEvent(&event) ) {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
73 if ( event.type == SDL_KEYDOWN )
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
74 return 0;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
75 }
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
76
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
77 /* First test fills and screen update speed */
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
78 printf("Running color fill and fullscreen update test\n");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
79 then = SDL_GetTicks();
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
80 frames = 0;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
81 for ( i = 0; i < 256; ++i ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
82 r = i;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
83 g = 0;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
84 b = 0;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
85 SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, r, g, b));
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
86 SDL_Flip(screen);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
87 ++frames;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
88 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
89 for ( i = 0; i < 256; ++i ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
90 r = 0;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
91 g = i;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
92 b = 0;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
93 SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, r, g, b));
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
94 SDL_Flip(screen);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
95 ++frames;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
96 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
97 for ( i = 0; i < 256; ++i ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
98 r = 0;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
99 g = 0;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
100 b = i;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
101 SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, r, g, b));
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
102 SDL_Flip(screen);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
103 ++frames;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
104 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
105 now = SDL_GetTicks();
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
106 seconds = (float)(now - then) / 1000.0f;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
107 if ( seconds > 0.0f ) {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
108 printf("%d fills and flips in %2.2f seconds, %2.2f FPS\n", frames, seconds, (float)frames / seconds);
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
109 } else {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
110 printf("%d fills and flips in zero seconds!n", frames);
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
111 }
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
112
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
113 while ( SDL_PollEvent(&event) ) {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
114 if ( event.type == SDL_KEYDOWN )
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
115 return 0;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
116 }
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
117
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
118 bmp = SDL_LoadBMP("sample.bmp");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
119 if ( ! bmp ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
120 printf("Couldn't load sample.bmp: %s\n", SDL_GetError());
482
6417071ba2e5 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 480
diff changeset
121 return 0;
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
122 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
123 printf("Running freshly loaded blit test: %dx%d at %d bpp, flags: ",
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
124 bmp->w, bmp->h, bmp->format->BitsPerPixel);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
125 PrintFlags(bmp->flags);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
126 printf("\n");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
127 then = SDL_GetTicks();
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
128 frames = RunBlitTests(screen, bmp, NUM_BLITS);
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
129 now = SDL_GetTicks();
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
130 seconds = (float)(now - then) / 1000.0f;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
131 if ( seconds > 0.0f ) {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
132 printf("%d blits / %d updates in %2.2f seconds, %2.2f FPS\n", NUM_BLITS*frames, frames, seconds, (float)frames / seconds);
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
133 } else {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
134 printf("%d blits / %d updates in zero seconds!\n", NUM_BLITS*frames, frames);
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
135 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
136
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
137 tmp = bmp;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
138 bmp = SDL_DisplayFormat(bmp);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
139 SDL_FreeSurface(tmp);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
140 if ( ! bmp ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
141 printf("Couldn't convert sample.bmp: %s\n", SDL_GetError());
482
6417071ba2e5 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 480
diff changeset
142 return 0;
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
143 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
144 printf("Running display format blit test: %dx%d at %d bpp, flags: ",
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
145 bmp->w, bmp->h, bmp->format->BitsPerPixel);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
146 PrintFlags(bmp->flags);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
147 printf("\n");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
148 then = SDL_GetTicks();
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
149 frames = RunBlitTests(screen, bmp, NUM_BLITS);
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
150 now = SDL_GetTicks();
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
151 seconds = (float)(now - then) / 1000.0f;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
152 if ( seconds > 0.0f ) {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
153 printf("%d blits / %d updates in %2.2f seconds, %2.2f FPS\n", NUM_BLITS*frames, frames, seconds, (float)frames / seconds);
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
154 } else {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
155 printf("%d blits / %d updates in zero seconds!\n", NUM_BLITS*frames, frames);
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
156 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
157 SDL_FreeSurface(bmp);
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
158
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
159 while ( SDL_PollEvent(&event) ) {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
160 if ( event.type == SDL_KEYDOWN )
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
161 return 0;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
162 }
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
163 return 1;
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
164 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
165
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
166 void RunVideoTests()
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
167 {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
168 static const struct {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
169 int w, h, bpp;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
170 } mode_list[] = {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
171 { 640, 480, 8 }, { 640, 480, 16 }, { 640, 480, 32 },
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
172 { 800, 600, 8 }, { 800, 600, 16 }, { 800, 600, 32 },
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
173 { 1024, 768, 8 }, { 1024, 768, 16 }, { 1024, 768, 32 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
174 };
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
175 static const Uint32 flags[] = {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
176 (SDL_SWSURFACE),
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
177 (SDL_SWSURFACE | SDL_FULLSCREEN),
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
178 (SDL_HWSURFACE | SDL_FULLSCREEN),
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
179 (SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF)
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
180 };
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
181 int i, j;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
182 SDL_Surface *screen;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
183
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
184 /* Test out several different video mode combinations */
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
185 SDL_WM_SetCaption("SDL Video Benchmark", "vidtest");
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
186 SDL_ShowCursor(0);
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
187 for ( i = 0; i < SDL_TABLESIZE(mode_list); ++i ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
188 for ( j = 0; j < SDL_TABLESIZE(flags); ++j ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
189 printf("===================================\n");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
190 printf("Setting video mode: %dx%d at %d bpp, flags: ",
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
191 mode_list[i].w,
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
192 mode_list[i].h,
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
193 mode_list[i].bpp);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
194 PrintFlags(flags[j]);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
195 printf("\n");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
196 screen = SDL_SetVideoMode(mode_list[i].w,
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
197 mode_list[i].h,
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
198 mode_list[i].bpp,
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
199 flags[j]);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
200 if ( ! screen ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
201 printf("Setting video mode failed: %s\n", SDL_GetError());
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
202 continue;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
203 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
204 if ( (screen->flags & FLAG_MASK) != flags[j] ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
205 printf("Flags didn't match: ");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
206 PrintFlags(screen->flags);
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
207 printf("\n");
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
208 continue;
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
209 }
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
210 if ( ! RunModeTests(screen) ) {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
211 return;
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
212 }
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
213 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
214 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
215 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
216
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
217 int main(int argc, char *argv[])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
218 {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
219 const SDL_VideoInfo *info;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
220 int i;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
221 SDL_Rect **modes;
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
222 char driver[128];
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
223
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
224 if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
225 fprintf(stderr,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
226 "Couldn't initialize SDL: %s\n", SDL_GetError());
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
227 exit(1);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
228 }
480
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
229 if ( SDL_VideoDriverName(driver, sizeof(driver)) ) {
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
230 printf("Video driver: %s\n", driver);
92596bfe8446 Fixed some bugs and added some features to the -benchmark facility
Sam Lantinga <slouken@libsdl.org>
parents: 479
diff changeset
231 }
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
232 info = SDL_GetVideoInfo();
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
233 printf(
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
234 "Current display: %d bits-per-pixel\n",info->vfmt->BitsPerPixel);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
235 if ( info->vfmt->palette == NULL ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
236 printf(" Red Mask = 0x%.8x\n", info->vfmt->Rmask);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
237 printf(" Green Mask = 0x%.8x\n", info->vfmt->Gmask);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
238 printf(" Blue Mask = 0x%.8x\n", info->vfmt->Bmask);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
239 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
240 /* Print available fullscreen video modes */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
241 modes = SDL_ListModes(NULL, SDL_FULLSCREEN);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
242 if ( modes == (SDL_Rect **)0 ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
243 printf("No available fullscreen video modes\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
244 } else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
245 if ( modes == (SDL_Rect **)-1 ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
246 printf("No special fullscreen video modes\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
247 } else {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
248 printf("Fullscreen video modes:\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
249 for ( i=0; modes[i]; ++i ) {
266
c6abdda2f666 Added QNX cleanups by Mike Gorchak (thanks!)
Sam Lantinga <slouken@libsdl.org>
parents: 0
diff changeset
250 printf("\t%dx%dx%d\n", modes[i]->w, modes[i]->h, info->vfmt->BitsPerPixel);
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
251 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
252 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
253 if ( info->wm_available ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
254 printf("A window manager is available\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
255 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
256 if ( info->hw_available ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
257 printf("Hardware surfaces are available (%dK video memory)\n",
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
258 info->video_mem);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
259 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
260 if ( info->blit_hw ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
261 printf(
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
262 "Copy blits between hardware surfaces are accelerated\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
263 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
264 if ( info->blit_hw_CC ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
265 printf(
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
266 "Colorkey blits between hardware surfaces are accelerated\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
267 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
268 if ( info->blit_hw_A ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
269 printf(
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
270 "Alpha blits between hardware surfaces are accelerated\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
271 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
272 if ( info->blit_sw ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
273 printf(
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
274 "Copy blits from software surfaces to hardware surfaces are accelerated\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
275 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
276 if ( info->blit_sw_CC ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
277 printf(
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
278 "Colorkey blits from software surfaces to hardware surfaces are accelerated\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
279 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
280 if ( info->blit_sw_A ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
281 printf(
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
282 "Alpha blits from software surfaces to hardware surfaces are accelerated\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
283 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
284 if ( info->blit_fill ) {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
285 printf(
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
286 "Color fills on hardware surfaces are accelerated\n");
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
287 }
479
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
288
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
289 if ( argv[1] && (strcmp(argv[1], "-benchmark") == 0) ) {
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
290 RunVideoTests();
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
291 }
c0a1744bc2cf Added a -benchmark flag for testing the speeds of various video modes
Sam Lantinga <slouken@libsdl.org>
parents: 266
diff changeset
292
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
293 SDL_Quit();
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
294 return(0);
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
295 }