test/testblitspeed.c
author Ryan C. Gordon <icculus@icculus.org>
Mon, 18 Feb 2019 00:26:53 -0500
changeset 69 a2c5f6a01a55
parent 0 a6cb692b8939
permissions -rw-r--r--
Fill in a default palette for 8-bit screen surfaces.
icculus@0
     1
/*
icculus@0
     2
 * Benchmarks surface-to-surface blits in various formats.
icculus@0
     3
 *
icculus@0
     4
 *  Written by Ryan C. Gordon.
icculus@0
     5
 */
icculus@0
     6
icculus@0
     7
#include <stdio.h>
icculus@0
     8
#include <stdlib.h>
icculus@0
     9
#include <string.h>
icculus@0
    10
icculus@0
    11
#include "SDL.h"
icculus@0
    12
icculus@0
    13
static SDL_Surface *dest = NULL;
icculus@0
    14
static SDL_Surface *src = NULL;
icculus@0
    15
static int testSeconds = 10;
icculus@0
    16
icculus@0
    17
icculus@0
    18
static int percent(int val, int total)
icculus@0
    19
{
icculus@0
    20
    return((int) ((((float) val) / ((float) total)) * 100.0f));
icculus@0
    21
}
icculus@0
    22
icculus@0
    23
static int randRange(int lo, int hi)
icculus@0
    24
{
icculus@0
    25
    return(lo + (int) (((double) hi)*rand()/(RAND_MAX+1.0)));
icculus@0
    26
}
icculus@0
    27
icculus@0
    28
static void copy_trunc_str(char *str, size_t strsize, const char *flagstr)
icculus@0
    29
{
icculus@0
    30
    if ( (strlen(str) + strlen(flagstr)) >= (strsize - 1) )
icculus@0
    31
        strcpy(str + (strsize - 5), " ...");
icculus@0
    32
    else
icculus@0
    33
        strcat(str, flagstr);
icculus@0
    34
}
icculus@0
    35
icculus@0
    36
static void __append_sdl_surface_flag(SDL_Surface *_surface, char *str,
icculus@0
    37
                                      size_t strsize, Uint32 flag,
icculus@0
    38
                                      const char *flagstr)
icculus@0
    39
{
icculus@0
    40
    if (_surface->flags & flag)
icculus@0
    41
        copy_trunc_str(str, strsize, flagstr);
icculus@0
    42
}
icculus@0
    43
icculus@0
    44
icculus@0
    45
#define append_sdl_surface_flag(a, b, c, fl) __append_sdl_surface_flag(a, b, c, fl, " " #fl)
icculus@0
    46
#define print_tf_state(str, val) printf("%s: {%s}\n", str, (val) ? "true" : "false" )
icculus@0
    47
icculus@0
    48
static void output_videoinfo_details(void)
icculus@0
    49
{
icculus@0
    50
    const SDL_VideoInfo *info = SDL_GetVideoInfo();
icculus@0
    51
    printf("SDL_GetVideoInfo():\n");
icculus@0
    52
    if (info == NULL)
icculus@0
    53
        printf("  (null.)\n");
icculus@0
    54
    else
icculus@0
    55
    {
icculus@0
    56
        print_tf_state("  hardware surface available", info->hw_available);
icculus@0
    57
        print_tf_state("  window manager available", info->wm_available);
icculus@0
    58
        print_tf_state("  accelerated hardware->hardware blits", info->blit_hw);
icculus@0
    59
        print_tf_state("  accelerated hardware->hardware colorkey blits", info->blit_hw_CC);
icculus@0
    60
        print_tf_state("  accelerated hardware->hardware alpha blits", info->blit_hw_A);
icculus@0
    61
        print_tf_state("  accelerated software->hardware blits", info->blit_sw);
icculus@0
    62
        print_tf_state("  accelerated software->hardware colorkey blits", info->blit_sw_CC);
icculus@0
    63
        print_tf_state("  accelerated software->hardware alpha blits", info->blit_sw_A);
icculus@0
    64
        print_tf_state("  accelerated color fills", info->blit_fill);
icculus@0
    65
        printf("  video memory: (%d)\n", info->video_mem);
icculus@0
    66
    }
icculus@0
    67
icculus@0
    68
    printf("\n");
icculus@0
    69
}
icculus@0
    70
icculus@0
    71
static void output_surface_details(const char *name, SDL_Surface *surface)
icculus@0
    72
{
icculus@0
    73
    printf("Details for %s:\n", name);
icculus@0
    74
icculus@0
    75
    if (surface == NULL)
icculus@0
    76
    {
icculus@0
    77
        printf("-WARNING- You've got a NULL surface!");
icculus@0
    78
    }
icculus@0
    79
    else
icculus@0
    80
    {
icculus@0
    81
        char f[256];
icculus@0
    82
        printf("  width      : %d\n", surface->w);
icculus@0
    83
        printf("  height     : %d\n", surface->h);
icculus@0
    84
        printf("  depth      : %d bits per pixel\n", surface->format->BitsPerPixel);
icculus@0
    85
        printf("  pitch      : %d\n", (int) surface->pitch);
icculus@0
    86
        printf("  alpha      : %d\n", (int) surface->format->alpha);
icculus@0
    87
        printf("  colorkey   : 0x%X\n", (unsigned int) surface->format->colorkey);
icculus@0
    88
icculus@0
    89
        printf("  red bits   : 0x%08X mask, %d shift, %d loss\n",
icculus@0
    90
                    (int) surface->format->Rmask,
icculus@0
    91
                    (int) surface->format->Rshift,
icculus@0
    92
                    (int) surface->format->Rloss);
icculus@0
    93
        printf("  green bits : 0x%08X mask, %d shift, %d loss\n",
icculus@0
    94
                    (int) surface->format->Gmask,
icculus@0
    95
                    (int) surface->format->Gshift,
icculus@0
    96
                    (int) surface->format->Gloss);
icculus@0
    97
        printf("  blue bits  : 0x%08X mask, %d shift, %d loss\n",
icculus@0
    98
                    (int) surface->format->Bmask,
icculus@0
    99
                    (int) surface->format->Bshift,
icculus@0
   100
                    (int) surface->format->Bloss);
icculus@0
   101
        printf("  alpha bits : 0x%08X mask, %d shift, %d loss\n",
icculus@0
   102
                    (int) surface->format->Amask,
icculus@0
   103
                    (int) surface->format->Ashift,
icculus@0
   104
                    (int) surface->format->Aloss);
icculus@0
   105
icculus@0
   106
        f[0] = '\0';
icculus@0
   107
icculus@0
   108
        /*append_sdl_surface_flag(surface, f, sizeof (f), SDL_SWSURFACE);*/
icculus@0
   109
        if ((surface->flags & SDL_HWSURFACE) == 0)
icculus@0
   110
            copy_trunc_str(f, sizeof (f), " SDL_SWSURFACE");
icculus@0
   111
icculus@0
   112
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_HWSURFACE);
icculus@0
   113
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_ASYNCBLIT);
icculus@0
   114
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_ANYFORMAT);
icculus@0
   115
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_HWPALETTE);
icculus@0
   116
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_DOUBLEBUF);
icculus@0
   117
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_FULLSCREEN);
icculus@0
   118
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_OPENGL);
icculus@0
   119
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_OPENGLBLIT);
icculus@0
   120
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_RESIZABLE);
icculus@0
   121
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_NOFRAME);
icculus@0
   122
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_HWACCEL);
icculus@0
   123
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_SRCCOLORKEY);
icculus@0
   124
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_RLEACCELOK);
icculus@0
   125
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_RLEACCEL);
icculus@0
   126
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_SRCALPHA);
icculus@0
   127
        append_sdl_surface_flag(surface, f, sizeof (f), SDL_PREALLOC);
icculus@0
   128
icculus@0
   129
        if (f[0] == '\0')
icculus@0
   130
            strcpy(f, " (none)");
icculus@0
   131
icculus@0
   132
        printf("  flags      :%s\n", f);
icculus@0
   133
    }
icculus@0
   134
icculus@0
   135
    printf("\n");
icculus@0
   136
}
icculus@0
   137
icculus@0
   138
static void output_details(void)
icculus@0
   139
{
icculus@0
   140
    output_videoinfo_details();
icculus@0
   141
    output_surface_details("Source Surface", src);
icculus@0
   142
    output_surface_details("Destination Surface", dest);
icculus@0
   143
}
icculus@0
   144
icculus@0
   145
static Uint32 blit(SDL_Surface *dst, SDL_Surface *src, int x, int y)
icculus@0
   146
{
icculus@0
   147
    Uint32 start = 0;
icculus@0
   148
    SDL_Rect srcRect;
icculus@0
   149
    SDL_Rect dstRect;
icculus@0
   150
icculus@0
   151
    srcRect.x = 0;
icculus@0
   152
    srcRect.y = 0;
icculus@0
   153
    dstRect.x = x;
icculus@0
   154
    dstRect.y = y;
icculus@0
   155
    dstRect.w = srcRect.w = src->w;  /* SDL will clip as appropriate. */
icculus@0
   156
    dstRect.h = srcRect.h = src->h;
icculus@0
   157
icculus@0
   158
    start = SDL_GetTicks();
icculus@0
   159
    SDL_BlitSurface(src, &srcRect, dst, &dstRect);
icculus@0
   160
    return(SDL_GetTicks() - start);
icculus@0
   161
}
icculus@0
   162
icculus@0
   163
static void blitCentered(SDL_Surface *dst, SDL_Surface *src)
icculus@0
   164
{
icculus@0
   165
    int x = (dst->w - src->w) / 2;
icculus@0
   166
    int y = (dst->h - src->h) / 2;
icculus@0
   167
    blit(dst, src, x, y);
icculus@0
   168
}
icculus@0
   169
icculus@0
   170
static int atoi_hex(const char *str)
icculus@0
   171
{
icculus@0
   172
    if (str == NULL)
icculus@0
   173
        return 0;
icculus@0
   174
icculus@0
   175
    if (strlen(str) > 2)
icculus@0
   176
    {
icculus@0
   177
        int retval = 0;
icculus@0
   178
        if ((str[0] == '0') && (str[1] == 'x'))
icculus@0
   179
            sscanf(str + 2, "%X", &retval);
icculus@0
   180
        return(retval);
icculus@0
   181
    }
icculus@0
   182
icculus@0
   183
    return(atoi(str));
icculus@0
   184
}
icculus@0
   185
icculus@0
   186
icculus@0
   187
static int setup_test(int argc, char **argv)
icculus@0
   188
{
icculus@0
   189
    const char *dumpfile = NULL;
icculus@0
   190
    SDL_Surface *bmp = NULL;
icculus@0
   191
    Uint32 dstbpp = 32;
icculus@0
   192
    Uint32 dstrmask = 0x00FF0000;
icculus@0
   193
    Uint32 dstgmask = 0x0000FF00;
icculus@0
   194
    Uint32 dstbmask = 0x000000FF;
icculus@0
   195
    Uint32 dstamask = 0x00000000;
icculus@0
   196
    Uint32 dstflags = 0;
icculus@0
   197
    int dstw = 640;
icculus@0
   198
    int dsth = 480;
icculus@0
   199
    Uint32 srcbpp = 32;
icculus@0
   200
    Uint32 srcrmask = 0x00FF0000;
icculus@0
   201
    Uint32 srcgmask = 0x0000FF00;
icculus@0
   202
    Uint32 srcbmask = 0x000000FF;
icculus@0
   203
    Uint32 srcamask = 0x00000000;
icculus@0
   204
    Uint32 srcflags = 0;
icculus@0
   205
    int srcw = 640;
icculus@0
   206
    int srch = 480;
icculus@0
   207
    Uint32 origsrcalphaflags = 0;
icculus@0
   208
    Uint32 origdstalphaflags = 0;
icculus@0
   209
    Uint32 srcalphaflags = 0;
icculus@0
   210
    Uint32 dstalphaflags = 0;
icculus@0
   211
    int srcalpha = 255;
icculus@0
   212
    int dstalpha = 255;
icculus@0
   213
    int screenSurface = 0;
icculus@0
   214
    int i = 0;
icculus@0
   215
icculus@0
   216
    for (i = 1; i < argc; i++)
icculus@0
   217
    {
icculus@0
   218
        const char *arg = argv[i];
icculus@0
   219
icculus@0
   220
        if (strcmp(arg, "--dstbpp") == 0)
icculus@0
   221
            dstbpp = atoi(argv[++i]);
icculus@0
   222
        else if (strcmp(arg, "--dstrmask") == 0)
icculus@0
   223
            dstrmask = atoi_hex(argv[++i]);
icculus@0
   224
        else if (strcmp(arg, "--dstgmask") == 0)
icculus@0
   225
            dstgmask = atoi_hex(argv[++i]);
icculus@0
   226
        else if (strcmp(arg, "--dstbmask") == 0)
icculus@0
   227
            dstbmask = atoi_hex(argv[++i]);
icculus@0
   228
        else if (strcmp(arg, "--dstamask") == 0)
icculus@0
   229
            dstamask = atoi_hex(argv[++i]);
icculus@0
   230
        else if (strcmp(arg, "--dstwidth") == 0)
icculus@0
   231
            dstw = atoi(argv[++i]);
icculus@0
   232
        else if (strcmp(arg, "--dstheight") == 0)
icculus@0
   233
            dsth = atoi(argv[++i]);
icculus@0
   234
        else if (strcmp(arg, "--dsthwsurface") == 0)
icculus@0
   235
            dstflags |= SDL_HWSURFACE;
icculus@0
   236
        else if (strcmp(arg, "--srcbpp") == 0)
icculus@0
   237
            srcbpp = atoi(argv[++i]);
icculus@0
   238
        else if (strcmp(arg, "--srcrmask") == 0)
icculus@0
   239
            srcrmask = atoi_hex(argv[++i]);
icculus@0
   240
        else if (strcmp(arg, "--srcgmask") == 0)
icculus@0
   241
            srcgmask = atoi_hex(argv[++i]);
icculus@0
   242
        else if (strcmp(arg, "--srcbmask") == 0)
icculus@0
   243
            srcbmask = atoi_hex(argv[++i]);
icculus@0
   244
        else if (strcmp(arg, "--srcamask") == 0)
icculus@0
   245
            srcamask = atoi_hex(argv[++i]);
icculus@0
   246
        else if (strcmp(arg, "--srcwidth") == 0)
icculus@0
   247
            srcw = atoi(argv[++i]);
icculus@0
   248
        else if (strcmp(arg, "--srcheight") == 0)
icculus@0
   249
            srch = atoi(argv[++i]);
icculus@0
   250
        else if (strcmp(arg, "--srchwsurface") == 0)
icculus@0
   251
            srcflags |= SDL_HWSURFACE;
icculus@0
   252
        else if (strcmp(arg, "--seconds") == 0)
icculus@0
   253
            testSeconds = atoi(argv[++i]);
icculus@0
   254
        else if (strcmp(arg, "--screen") == 0)
icculus@0
   255
            screenSurface = 1;
icculus@0
   256
        else if (strcmp(arg, "--dumpfile") == 0)
icculus@0
   257
            dumpfile = argv[++i];
icculus@0
   258
        /* !!! FIXME: set colorkey. */
icculus@0
   259
        else if (0)  /* !!! FIXME: we handle some commandlines elsewhere now */
icculus@0
   260
        {
icculus@0
   261
            fprintf(stderr, "Unknown commandline option: %s\n", arg);
icculus@0
   262
            return(0);
icculus@0
   263
        }
icculus@0
   264
    }
icculus@0
   265
icculus@0
   266
    if (SDL_Init(SDL_INIT_VIDEO) == -1)
icculus@0
   267
    {
icculus@0
   268
        fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
icculus@0
   269
        return(0);
icculus@0
   270
    }
icculus@0
   271
icculus@0
   272
    bmp = SDL_LoadBMP("sample.bmp");
icculus@0
   273
    if (bmp == NULL)
icculus@0
   274
    {
icculus@0
   275
        fprintf(stderr, "SDL_LoadBMP failed: %s\n", SDL_GetError());
icculus@0
   276
        SDL_Quit();
icculus@0
   277
        return(0);
icculus@0
   278
    }
icculus@0
   279
icculus@0
   280
    if ((dstflags & SDL_HWSURFACE) == 0) dstflags |= SDL_SWSURFACE;
icculus@0
   281
    if ((srcflags & SDL_HWSURFACE) == 0) srcflags |= SDL_SWSURFACE;
icculus@0
   282
icculus@0
   283
    if (screenSurface)
icculus@0
   284
        dest = SDL_SetVideoMode(dstw, dsth, dstbpp, dstflags);
icculus@0
   285
    else
icculus@0
   286
    {
icculus@0
   287
        dest = SDL_CreateRGBSurface(dstflags, dstw, dsth, dstbpp,
icculus@0
   288
                                    dstrmask, dstgmask, dstbmask, dstamask);
icculus@0
   289
    }
icculus@0
   290
icculus@0
   291
    if (dest == NULL)
icculus@0
   292
    {
icculus@0
   293
        fprintf(stderr, "dest surface creation failed: %s\n", SDL_GetError());
icculus@0
   294
        SDL_Quit();
icculus@0
   295
        return(0);
icculus@0
   296
    }
icculus@0
   297
icculus@0
   298
    src = SDL_CreateRGBSurface(srcflags, srcw, srch, srcbpp,
icculus@0
   299
                               srcrmask, srcgmask, srcbmask, srcamask);
icculus@0
   300
    if (src == NULL)
icculus@0
   301
    {
icculus@0
   302
        fprintf(stderr, "src surface creation failed: %s\n", SDL_GetError());
icculus@0
   303
        SDL_Quit();
icculus@0
   304
        return(0);
icculus@0
   305
    }
icculus@0
   306
icculus@0
   307
    /* handle alpha settings... */
icculus@0
   308
    srcalphaflags = (src->flags&SDL_SRCALPHA) | (src->flags&SDL_RLEACCEL);
icculus@0
   309
    dstalphaflags = (dest->flags&SDL_SRCALPHA) | (dest->flags&SDL_RLEACCEL);
icculus@0
   310
    origsrcalphaflags = srcalphaflags;
icculus@0
   311
    origdstalphaflags = dstalphaflags;
icculus@0
   312
    srcalpha = src->format->alpha;
icculus@0
   313
    dstalpha = dest->format->alpha;
icculus@0
   314
    for (i = 1; i < argc; i++)
icculus@0
   315
    {
icculus@0
   316
        const char *arg = argv[i];
icculus@0
   317
icculus@0
   318
        if (strcmp(arg, "--srcalpha") == 0)
icculus@0
   319
            srcalpha = atoi(argv[++i]);
icculus@0
   320
        else if (strcmp(arg, "--dstalpha") == 0)
icculus@0
   321
            dstalpha = atoi(argv[++i]);
icculus@0
   322
        else if (strcmp(arg, "--srcsrcalpha") == 0)
icculus@0
   323
            srcalphaflags |= SDL_SRCALPHA;
icculus@0
   324
        else if (strcmp(arg, "--srcnosrcalpha") == 0)
icculus@0
   325
            srcalphaflags &= ~SDL_SRCALPHA;
icculus@0
   326
        else if (strcmp(arg, "--srcrleaccel") == 0)
icculus@0
   327
            srcalphaflags |= SDL_RLEACCEL;
icculus@0
   328
        else if (strcmp(arg, "--srcnorleaccel") == 0)
icculus@0
   329
            srcalphaflags &= ~SDL_RLEACCEL;
icculus@0
   330
        else if (strcmp(arg, "--dstsrcalpha") == 0)
icculus@0
   331
            dstalphaflags |= SDL_SRCALPHA;
icculus@0
   332
        else if (strcmp(arg, "--dstnosrcalpha") == 0)
icculus@0
   333
            dstalphaflags &= ~SDL_SRCALPHA;
icculus@0
   334
        else if (strcmp(arg, "--dstrleaccel") == 0)
icculus@0
   335
            dstalphaflags |= SDL_RLEACCEL;
icculus@0
   336
        else if (strcmp(arg, "--dstnorleaccel") == 0)
icculus@0
   337
            dstalphaflags &= ~SDL_RLEACCEL;
icculus@0
   338
    }
icculus@0
   339
    if ((dstalphaflags != origdstalphaflags) || (dstalpha != dest->format->alpha))
icculus@0
   340
        SDL_SetAlpha(dest, dstalphaflags, (Uint8) dstalpha);
icculus@0
   341
    if ((srcalphaflags != origsrcalphaflags) || (srcalpha != src->format->alpha))
icculus@0
   342
        SDL_SetAlpha(src, srcalphaflags, (Uint8) srcalpha);
icculus@0
   343
icculus@0
   344
    /* set some sane defaults so we can see if the blit code is broken... */
icculus@0
   345
    SDL_FillRect(dest, NULL, SDL_MapRGB(dest->format, 0, 0, 0));
icculus@0
   346
    SDL_FillRect(src, NULL, SDL_MapRGB(src->format, 0, 0, 0));
icculus@0
   347
icculus@0
   348
    blitCentered(src, bmp);
icculus@0
   349
    SDL_FreeSurface(bmp);
icculus@0
   350
icculus@0
   351
    if (dumpfile)
icculus@0
   352
        SDL_SaveBMP(src, dumpfile);  /* make sure initial convert is sane. */
icculus@0
   353
icculus@0
   354
    output_details();
icculus@0
   355
icculus@0
   356
    return(1);
icculus@0
   357
}
icculus@0
   358
icculus@0
   359
icculus@0
   360
static void test_blit_speed(void)
icculus@0
   361
{
icculus@0
   362
    Uint32 clearColor = SDL_MapRGB(dest->format, 0, 0, 0);
icculus@0
   363
    Uint32 iterations = 0;
icculus@0
   364
    Uint32 elasped = 0;
icculus@0
   365
    Uint32 end = 0;
icculus@0
   366
    Uint32 now = 0;
icculus@0
   367
    Uint32 last = 0;
icculus@0
   368
    int testms = testSeconds * 1000;
icculus@0
   369
    int wmax = (dest->w - src->w);
icculus@0
   370
    int hmax = (dest->h - src->h);
icculus@0
   371
    int isScreen = (SDL_GetVideoSurface() == dest);
icculus@0
   372
    SDL_Event event;
icculus@0
   373
icculus@0
   374
    printf("Testing blit speed for %d seconds...\n", testSeconds);
icculus@0
   375
icculus@0
   376
    now = SDL_GetTicks();
icculus@0
   377
    end = now + testms;
icculus@0
   378
icculus@0
   379
    do
icculus@0
   380
    {
icculus@0
   381
        /* pump the event queue occasionally to keep OS happy... */
icculus@0
   382
        if (now - last > 1000)
icculus@0
   383
        {
icculus@0
   384
            last = now;
icculus@0
   385
            while (SDL_PollEvent(&event)) { /* no-op. */ }
icculus@0
   386
        }
icculus@0
   387
icculus@0
   388
        iterations++;
icculus@0
   389
        elasped += blit(dest, src, randRange(0, wmax), randRange(0, hmax));
icculus@0
   390
        if (isScreen)
icculus@0
   391
        {
icculus@0
   392
            SDL_Flip(dest);  /* show it! */
icculus@0
   393
            SDL_FillRect(dest, NULL, clearColor); /* blank it for next time! */
icculus@0
   394
        }
icculus@0
   395
icculus@0
   396
        now = SDL_GetTicks();
icculus@0
   397
    } while (now < end);
icculus@0
   398
icculus@0
   399
    printf("Non-blitting crap accounted for %d percent of this run.\n",
icculus@0
   400
            percent(testms - elasped, testms));
icculus@0
   401
icculus@0
   402
    printf("%d blits took %d ms (%d fps).\n",
icculus@0
   403
            (int) iterations,
icculus@0
   404
            (int) elasped,
icculus@0
   405
            (int) (((float)iterations) / (((float)elasped) / 1000.0f)));
icculus@0
   406
}
icculus@0
   407
icculus@0
   408
int main(int argc, char **argv)
icculus@0
   409
{
icculus@0
   410
    int initialized = setup_test(argc, argv);
icculus@0
   411
    if (initialized)
icculus@0
   412
    {
icculus@0
   413
        test_blit_speed();
icculus@0
   414
        SDL_Quit();
icculus@0
   415
    }
icculus@0
   416
    return(!initialized);
icculus@0
   417
}
icculus@0
   418
icculus@0
   419
/* end of testblitspeed.c ... */
icculus@0
   420