test/testoverlay2.c
author Sam Lantinga <slouken@libsdl.org>
Thu, 25 Jul 2013 09:51:21 -0700
changeset 7517 965d57022c01
parent 7504 5a45a9536a65
child 7639 9406b7dd2f2d
permissions -rw-r--r--
Updated the copyright year for the test programs
slouken@5535
     1
/*
slouken@7517
     2
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
slouken@5535
     3
slouken@5535
     4
  This software is provided 'as-is', without any express or implied
slouken@5535
     5
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     6
  arising from the use of this software.
slouken@5535
     7
slouken@5535
     8
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
     9
  including commercial applications, and to alter it and redistribute it
slouken@5535
    10
  freely.
slouken@5535
    11
*/
slouken@672
    12
/********************************************************************************
slouken@672
    13
 *                                                                              *
slouken@672
    14
 * Test of the overlay used for moved pictures, test more closed to real life.  *
slouken@672
    15
 * Running trojan moose :) Coded by Mike Gorchak.                               *
slouken@672
    16
 *                                                                              *
slouken@672
    17
 ********************************************************************************/
slouken@672
    18
slouken@1030
    19
#include <stdlib.h>
slouken@1030
    20
#include <stdio.h>
slouken@1030
    21
#include <string.h>
slouken@1030
    22
slouken@672
    23
#include "SDL.h"
slouken@672
    24
slouken@672
    25
#define MOOSEPIC_W 64
slouken@672
    26
#define MOOSEPIC_H 88
slouken@672
    27
slouken@672
    28
#define MOOSEFRAME_SIZE (MOOSEPIC_W * MOOSEPIC_H)
slouken@672
    29
#define MOOSEFRAMES_COUNT 10
slouken@672
    30
slouken@1895
    31
SDL_Color MooseColors[84] = {
slouken@1895
    32
    {49, 49, 49}
slouken@1895
    33
    , {66, 24, 0}
slouken@1895
    34
    , {66, 33, 0}
slouken@1895
    35
    , {66, 66, 66}
slouken@1895
    36
    ,
slouken@1895
    37
    {66, 115, 49}
slouken@1895
    38
    , {74, 33, 0}
slouken@1895
    39
    , {74, 41, 16}
slouken@1895
    40
    , {82, 33, 8}
slouken@1895
    41
    ,
slouken@1895
    42
    {82, 41, 8}
slouken@1895
    43
    , {82, 49, 16}
slouken@1895
    44
    , {82, 82, 82}
slouken@1895
    45
    , {90, 41, 8}
slouken@1895
    46
    ,
slouken@1895
    47
    {90, 41, 16}
slouken@1895
    48
    , {90, 57, 24}
slouken@1895
    49
    , {99, 49, 16}
slouken@1895
    50
    , {99, 66, 24}
slouken@1895
    51
    ,
slouken@1895
    52
    {99, 66, 33}
slouken@1895
    53
    , {99, 74, 33}
slouken@1895
    54
    , {107, 57, 24}
slouken@1895
    55
    , {107, 82, 41}
slouken@1895
    56
    ,
slouken@1895
    57
    {115, 57, 33}
slouken@1895
    58
    , {115, 66, 33}
slouken@1895
    59
    , {115, 66, 41}
slouken@1895
    60
    , {115, 74, 0}
slouken@1895
    61
    ,
slouken@1895
    62
    {115, 90, 49}
slouken@1895
    63
    , {115, 115, 115}
slouken@1895
    64
    , {123, 82, 0}
slouken@1895
    65
    , {123, 99, 57}
slouken@1895
    66
    ,
slouken@1895
    67
    {132, 66, 41}
slouken@1895
    68
    , {132, 74, 41}
slouken@1895
    69
    , {132, 90, 8}
slouken@1895
    70
    , {132, 99, 33}
slouken@1895
    71
    ,
slouken@1895
    72
    {132, 99, 66}
slouken@1895
    73
    , {132, 107, 66}
slouken@1895
    74
    , {140, 74, 49}
slouken@1895
    75
    , {140, 99, 16}
slouken@1895
    76
    ,
slouken@1895
    77
    {140, 107, 74}
slouken@1895
    78
    , {140, 115, 74}
slouken@1895
    79
    , {148, 107, 24}
slouken@1895
    80
    , {148, 115, 82}
slouken@1895
    81
    ,
slouken@1895
    82
    {148, 123, 74}
slouken@1895
    83
    , {148, 123, 90}
slouken@1895
    84
    , {156, 115, 33}
slouken@1895
    85
    , {156, 115, 90}
slouken@1895
    86
    ,
slouken@1895
    87
    {156, 123, 82}
slouken@1895
    88
    , {156, 132, 82}
slouken@1895
    89
    , {156, 132, 99}
slouken@1895
    90
    , {156, 156, 156}
slouken@1895
    91
    ,
slouken@1895
    92
    {165, 123, 49}
slouken@1895
    93
    , {165, 123, 90}
slouken@1895
    94
    , {165, 132, 82}
slouken@1895
    95
    , {165, 132, 90}
slouken@1895
    96
    ,
slouken@1895
    97
    {165, 132, 99}
slouken@1895
    98
    , {165, 140, 90}
slouken@1895
    99
    , {173, 132, 57}
slouken@1895
   100
    , {173, 132, 99}
slouken@1895
   101
    ,
slouken@1895
   102
    {173, 140, 107}
slouken@1895
   103
    , {173, 140, 115}
slouken@1895
   104
    , {173, 148, 99}
slouken@1895
   105
    , {173, 173, 173}
slouken@1895
   106
    ,
slouken@1895
   107
    {181, 140, 74}
slouken@1895
   108
    , {181, 148, 115}
slouken@1895
   109
    , {181, 148, 123}
slouken@1895
   110
    , {181, 156, 107}
slouken@1895
   111
    ,
slouken@1895
   112
    {189, 148, 123}
slouken@1895
   113
    , {189, 156, 82}
slouken@1895
   114
    , {189, 156, 123}
slouken@1895
   115
    , {189, 156, 132}
slouken@1895
   116
    ,
slouken@1895
   117
    {189, 189, 189}
slouken@1895
   118
    , {198, 156, 123}
slouken@1895
   119
    , {198, 165, 132}
slouken@1895
   120
    , {206, 165, 99}
slouken@1895
   121
    ,
slouken@1895
   122
    {206, 165, 132}
slouken@1895
   123
    , {206, 173, 140}
slouken@1895
   124
    , {206, 206, 206}
slouken@1895
   125
    , {214, 173, 115}
slouken@1895
   126
    ,
slouken@1895
   127
    {214, 173, 140}
slouken@1895
   128
    , {222, 181, 148}
slouken@1895
   129
    , {222, 189, 132}
slouken@1895
   130
    , {222, 189, 156}
slouken@1895
   131
    ,
slouken@1895
   132
    {222, 222, 222}
slouken@1895
   133
    , {231, 198, 165}
slouken@1895
   134
    , {231, 231, 231}
slouken@1895
   135
    , {239, 206, 173}
slouken@672
   136
};
slouken@672
   137
icculus@1151
   138
icculus@1151
   139
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
slouken@1895
   140
static void
slouken@1895
   141
quit(int rc)
icculus@1151
   142
{
slouken@1895
   143
    SDL_Quit();
slouken@1895
   144
    exit(rc);
icculus@1151
   145
}
icculus@1151
   146
slouken@672
   147
/* All RGB2YUV conversion code and some other parts of code has been taken from testoverlay.c */
slouken@672
   148
slouken@672
   149
/* NOTE: These RGB conversion functions are not intended for speed,
slouken@672
   150
         only as examples.
slouken@672
   151
*/
slouken@672
   152
slouken@1895
   153
void
slouken@1895
   154
RGBtoYUV(Uint8 * rgb, int *yuv, int monochrome, int luminance)
slouken@672
   155
{
slouken@1895
   156
    if (monochrome) {
slouken@1895
   157
#if 1                           /* these are the two formulas that I found on the FourCC site... */
aschiffler@4884
   158
        yuv[0] = (int)(0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]);
slouken@672
   159
        yuv[1] = 128;
slouken@672
   160
        yuv[2] = 128;
slouken@672
   161
#else
aschiffler@4884
   162
        yuv[0] = (int)(0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
slouken@672
   163
        yuv[1] = 128;
slouken@672
   164
        yuv[2] = 128;
slouken@672
   165
#endif
slouken@1895
   166
    } else {
slouken@1895
   167
#if 1                           /* these are the two formulas that I found on the FourCC site... */
aschiffler@4884
   168
        yuv[0] = (int)(0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2]);
aschiffler@4884
   169
        yuv[1] = (int)((rgb[2] - yuv[0]) * 0.565 + 128);
aschiffler@4884
   170
        yuv[2] = (int)((rgb[0] - yuv[0]) * 0.713 + 128);
slouken@672
   171
#else
slouken@672
   172
        yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
slouken@672
   173
        yuv[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]);
slouken@672
   174
        yuv[2] = 128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]);
slouken@672
   175
#endif
slouken@672
   176
    }
slouken@672
   177
slouken@1895
   178
    if (luminance != 100) {
slouken@1895
   179
        yuv[0] = yuv[0] * luminance / 100;
slouken@1895
   180
        if (yuv[0] > 255)
slouken@1895
   181
            yuv[0] = 255;
slouken@672
   182
    }
slouken@672
   183
}
slouken@672
   184
slouken@1895
   185
void
slouken@5216
   186
ConvertRGBtoYV12(Uint8 *rgb, Uint8 *out, int w, int h,
slouken@5216
   187
                 int monochrome, int luminance)
slouken@672
   188
{
slouken@1895
   189
    int x, y;
slouken@1895
   190
    int yuv[3];
slouken@5216
   191
    Uint8 *op[3];
slouken@672
   192
slouken@5216
   193
    op[0] = out;
slouken@5216
   194
    op[1] = op[0] + w*h;
slouken@5216
   195
    op[2] = op[1] + w*h/4;
slouken@5216
   196
    for (y = 0; y < h; ++y) {
slouken@5216
   197
        for (x = 0; x < w; ++x) {
slouken@5216
   198
            RGBtoYUV(rgb, yuv, monochrome, luminance);
slouken@1895
   199
            *(op[0]++) = yuv[0];
slouken@1895
   200
            if (x % 2 == 0 && y % 2 == 0) {
slouken@1895
   201
                *(op[1]++) = yuv[2];
slouken@1895
   202
                *(op[2]++) = yuv[1];
slouken@1895
   203
            }
slouken@5216
   204
            rgb += 3;
slouken@1895
   205
        }
slouken@1895
   206
    }
slouken@672
   207
}
slouken@672
   208
slouken@1895
   209
static void
slouken@1895
   210
PrintUsage(char *argv0)
slouken@672
   211
{
slouken@672
   212
    fprintf(stderr, "Usage: %s [arg] [arg] [arg] ...\n", argv0);
slouken@886
   213
    fprintf(stderr, "\n");
slouken@886
   214
    fprintf(stderr, "Where 'arg' is any of the following options:\n");
slouken@886
   215
    fprintf(stderr, "\n");
slouken@5216
   216
    fprintf(stderr, "    -fps <frames per second>\n");
slouken@5216
   217
    fprintf(stderr, "    -nodelay\n");
slouken@5216
   218
    fprintf(stderr, "    -format <fmt> (one of the: YV12, IYUV, YUY2, UYVY, YVYU)\n");
slouken@5216
   219
    fprintf(stderr, "    -scale <scale factor> (initial scale of the overlay)\n");
slouken@5216
   220
    fprintf(stderr, "    -help (shows this help)\n");
slouken@672
   221
    fprintf(stderr, "\n");
slouken@1895
   222
    fprintf(stderr,
slouken@1895
   223
            "Press ESC to exit, or SPACE to freeze the movie while application running.\n");
slouken@672
   224
    fprintf(stderr, "\n");
slouken@672
   225
}
slouken@672
   226
slouken@1895
   227
int
slouken@1895
   228
main(int argc, char **argv)
slouken@672
   229
{
slouken@1895
   230
    Uint8 *RawMooseData;
slouken@1895
   231
    SDL_RWops *handle;
slouken@5216
   232
    int window_w;
slouken@5216
   233
    int window_h;
slouken@5216
   234
    SDL_Window *window;
slouken@5216
   235
    SDL_Renderer *renderer;
slouken@5216
   236
    Uint8 MooseFrame[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE*2];
slouken@5216
   237
    SDL_Texture *MooseTexture;
slouken@5216
   238
    SDL_Rect displayrect;
slouken@672
   239
    SDL_Event event;
slouken@1895
   240
    int paused = 0;
slouken@5216
   241
    int i, j;
slouken@1895
   242
    int fps = 12;
slouken@672
   243
    int fpsdelay;
slouken@5216
   244
    int nodelay = 0;
slouken@5264
   245
    Uint32 pixel_format = SDL_PIXELFORMAT_YV12;
slouken@1895
   246
    int scale = 5;
slouken@5216
   247
    SDL_bool done = SDL_FALSE;
slouken@672
   248
slouken@7504
   249
    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
icculus@1151
   250
        fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
icculus@1151
   251
        return 3;
icculus@1151
   252
    }
icculus@1151
   253
slouken@1895
   254
    while (argc > 1) {
slouken@1895
   255
        if (strcmp(argv[1], "-fps") == 0) {
slouken@1895
   256
            if (argv[2]) {
slouken@672
   257
                fps = atoi(argv[2]);
slouken@1895
   258
                if (fps == 0) {
slouken@1895
   259
                    fprintf(stderr,
slouken@1895
   260
                            "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
icculus@1151
   261
                    quit(10);
slouken@672
   262
                }
slouken@1895
   263
                if ((fps < 0) || (fps > 1000)) {
slouken@1895
   264
                    fprintf(stderr,
slouken@1895
   265
                            "The -fps option must be in range from 1 to 1000, default is 12.\n");
icculus@1151
   266
                    quit(10);
slouken@672
   267
                }
slouken@672
   268
                argv += 2;
slouken@672
   269
                argc -= 2;
slouken@1895
   270
            } else {
slouken@1895
   271
                fprintf(stderr,
slouken@1895
   272
                        "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
icculus@1151
   273
                quit(10);
slouken@672
   274
            }
slouken@5216
   275
        } else if (strcmp(argv[1], "-nodelay") == 0) {
slouken@5216
   276
            nodelay = 1;
slouken@5216
   277
            argv += 1;
slouken@5216
   278
            argc -= 1;
slouken@1895
   279
        } else if (strcmp(argv[1], "-scale") == 0) {
slouken@1895
   280
            if (argv[2]) {
slouken@672
   281
                scale = atoi(argv[2]);
slouken@1895
   282
                if (scale == 0) {
slouken@1895
   283
                    fprintf(stderr,
slouken@1895
   284
                            "The -scale option requires an argument [from 1 to 50], default is 5.\n");
icculus@1151
   285
                    quit(10);
slouken@672
   286
                }
slouken@1895
   287
                if ((scale < 0) || (scale > 50)) {
slouken@1895
   288
                    fprintf(stderr,
slouken@1895
   289
                            "The -scale option must be in range from 1 to 50, default is 5.\n");
icculus@1151
   290
                    quit(10);
slouken@672
   291
                }
slouken@672
   292
                argv += 2;
slouken@672
   293
                argc -= 2;
slouken@1895
   294
            } else {
slouken@1895
   295
                fprintf(stderr,
slouken@1895
   296
                        "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
icculus@1151
   297
                quit(10);
slouken@672
   298
            }
slouken@1895
   299
        } else if ((strcmp(argv[1], "-help") == 0)
slouken@1895
   300
                   || (strcmp(argv[1], "-h") == 0)) {
slouken@672
   301
            PrintUsage(argv[0]);
icculus@1151
   302
            quit(0);
slouken@1895
   303
        } else {
slouken@672
   304
            fprintf(stderr, "Unrecognized option: %s.\n", argv[1]);
icculus@1151
   305
            quit(10);
slouken@672
   306
        }
slouken@672
   307
        break;
slouken@672
   308
    }
slouken@1895
   309
slouken@1895
   310
    RawMooseData = (Uint8 *) malloc(MOOSEFRAME_SIZE * MOOSEFRAMES_COUNT);
slouken@1895
   311
    if (RawMooseData == NULL) {
slouken@672
   312
        fprintf(stderr, "Can't allocate memory for movie !\n");
slouken@672
   313
        free(RawMooseData);
icculus@1151
   314
        quit(1);
slouken@672
   315
    }
slouken@672
   316
slouken@672
   317
    /* load the trojan moose images */
slouken@1895
   318
    handle = SDL_RWFromFile("moose.dat", "rb");
slouken@1895
   319
    if (handle == NULL) {
slouken@672
   320
        fprintf(stderr, "Can't find the file moose.dat !\n");
slouken@672
   321
        free(RawMooseData);
icculus@1151
   322
        quit(2);
slouken@672
   323
    }
slouken@1895
   324
slouken@672
   325
    SDL_RWread(handle, RawMooseData, MOOSEFRAME_SIZE, MOOSEFRAMES_COUNT);
slouken@672
   326
slouken@672
   327
    SDL_RWclose(handle);
slouken@672
   328
slouken@5216
   329
    /* Create the window and renderer */
slouken@5216
   330
    window_w = MOOSEPIC_W * scale;
slouken@5216
   331
    window_h = MOOSEPIC_H * scale;
slouken@5216
   332
    window = SDL_CreateWindow("Happy Moose",
slouken@5216
   333
                              SDL_WINDOWPOS_UNDEFINED,
slouken@5216
   334
                              SDL_WINDOWPOS_UNDEFINED,
slouken@5216
   335
                              window_w, window_h,
philipp@7478
   336
                              SDL_WINDOW_RESIZABLE);
slouken@5216
   337
    if (!window) {
slouken@5216
   338
        fprintf(stderr, "Couldn't set create window: %s\n", SDL_GetError());
slouken@672
   339
        free(RawMooseData);
icculus@1151
   340
        quit(4);
slouken@672
   341
    }
slouken@672
   342
slouken@5216
   343
    renderer = SDL_CreateRenderer(window, -1, 0);
slouken@5216
   344
    if (!renderer) {
slouken@5216
   345
        fprintf(stderr, "Couldn't set create renderer: %s\n", SDL_GetError());
slouken@5216
   346
        free(RawMooseData);
slouken@5216
   347
        quit(4);
slouken@5216
   348
    }
slouken@5216
   349
slouken@5264
   350
    MooseTexture = SDL_CreateTexture(renderer, pixel_format, SDL_TEXTUREACCESS_STREAMING, MOOSEPIC_W, MOOSEPIC_H);
slouken@5252
   351
    if (!MooseTexture) {
slouken@5216
   352
        fprintf(stderr, "Couldn't set create texture: %s\n", SDL_GetError());
slouken@5216
   353
        free(RawMooseData);
slouken@5216
   354
        quit(5);
slouken@5216
   355
    }
slouken@7504
   356
    /* Uncomment this to check vertex color with a YUV texture */
slouken@7504
   357
    /*SDL_SetTextureColorMod(MooseTexture, 0xff, 0x80, 0x80);*/
slouken@672
   358
slouken@1895
   359
    for (i = 0; i < MOOSEFRAMES_COUNT; i++) {
slouken@5216
   360
        Uint8 MooseFrameRGB[MOOSEFRAME_SIZE*3];
slouken@5216
   361
        Uint8 *rgb;
slouken@5216
   362
        Uint8 *frame;
slouken@5216
   363
slouken@5216
   364
        rgb = MooseFrameRGB;
slouken@5216
   365
        frame = RawMooseData + i * MOOSEFRAME_SIZE;
slouken@5216
   366
        for (j = 0; j < MOOSEFRAME_SIZE; ++j) {
slouken@5216
   367
            rgb[0] = MooseColors[frame[j]].r;
slouken@5216
   368
            rgb[1] = MooseColors[frame[j]].g;
slouken@5216
   369
            rgb[2] = MooseColors[frame[j]].b;
slouken@5216
   370
            rgb += 3;
slouken@672
   371
        }
slouken@5216
   372
        ConvertRGBtoYV12(MooseFrameRGB, MooseFrame[i], MOOSEPIC_W, MOOSEPIC_H, 0, 100);
slouken@672
   373
    }
slouken@672
   374
slouken@672
   375
    free(RawMooseData);
slouken@672
   376
slouken@5216
   377
    /* set the start frame */
slouken@5216
   378
    i = 0;
slouken@5216
   379
    if (nodelay) {
slouken@5216
   380
        fpsdelay = 0;
slouken@5216
   381
    } else {
slouken@5216
   382
        fpsdelay = 1000 / fps;
slouken@886
   383
    }
slouken@672
   384
slouken@5216
   385
    displayrect.x = 0;
slouken@5216
   386
    displayrect.y = 0;
slouken@5216
   387
    displayrect.w = window_w;
slouken@5216
   388
    displayrect.h = window_h;
slouken@672
   389
slouken@672
   390
    /* Ignore key up events, they don't even get filtered */
slouken@672
   391
    SDL_EventState(SDL_KEYUP, SDL_IGNORE);
slouken@672
   392
slouken@672
   393
    /* Loop, waiting for QUIT or RESIZE */
slouken@5216
   394
    while (!done) {
slouken@5216
   395
        while (SDL_PollEvent(&event)) {
slouken@1895
   396
            switch (event.type) {
slouken@5216
   397
            case SDL_WINDOWEVENT:
slouken@5216
   398
                if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
slouken@5357
   399
                    SDL_RenderSetViewport(renderer, NULL);
slouken@5216
   400
                    displayrect.w = window_w = event.window.data1;
slouken@5274
   401
                    displayrect.h = window_h = event.window.data2;
slouken@1895
   402
                }
slouken@1895
   403
                break;
slouken@1895
   404
            case SDL_MOUSEBUTTONDOWN:
slouken@5216
   405
                displayrect.x = event.button.x - window_w / 2;
slouken@5216
   406
                displayrect.y = event.button.y - window_h / 2;
slouken@5216
   407
                break;
slouken@5216
   408
            case SDL_MOUSEMOTION:
slouken@5216
   409
                if (event.motion.state) {
slouken@5216
   410
                    displayrect.x = event.motion.x - window_w / 2;
slouken@5216
   411
                    displayrect.y = event.motion.y - window_h / 2;
slouken@5216
   412
                }
slouken@1895
   413
                break;
slouken@1895
   414
            case SDL_KEYDOWN:
slouken@1895
   415
                if (event.key.keysym.sym == SDLK_SPACE) {
slouken@1895
   416
                    paused = !paused;
slouken@1895
   417
                    break;
slouken@1895
   418
                }
slouken@1895
   419
                if (event.key.keysym.sym != SDLK_ESCAPE) {
slouken@1895
   420
                    break;
slouken@1895
   421
                }
slouken@1895
   422
            case SDL_QUIT:
slouken@5216
   423
                done = SDL_TRUE;
slouken@5216
   424
                break;
slouken@672
   425
            }
slouken@672
   426
        }
slouken@5216
   427
        SDL_Delay(fpsdelay);
slouken@672
   428
slouken@5216
   429
        if (!paused) {
slouken@5216
   430
            i = (i + 1) % MOOSEFRAMES_COUNT;
slouken@672
   431
slouken@5264
   432
            SDL_UpdateTexture(MooseTexture, NULL, MooseFrame[i], MOOSEPIC_W*SDL_BYTESPERPIXEL(pixel_format));
slouken@672
   433
        }
slouken@5216
   434
        SDL_RenderClear(renderer);
slouken@5216
   435
        SDL_RenderCopy(renderer, MooseTexture, NULL, &displayrect);
slouken@5216
   436
        SDL_RenderPresent(renderer);
slouken@672
   437
    }
slouken@5216
   438
    SDL_DestroyRenderer(renderer);
slouken@5216
   439
    quit(0);
slouken@672
   440
    return 0;
slouken@672
   441
}
slouken@5216
   442
slouken@5216
   443
/* vi: set ts=4 sw=4 expandtab: */