test/testhittesting.c
author Ryan C. Gordon <icculus@icculus.org>
Fri, 12 Aug 2016 19:59:00 -0400
changeset 10266 c09f06c4e8c8
parent 8947 14d3e9f93c16
permissions -rw-r--r--
emscripten: send fake mouse events for touches, like other targets do. (This really should be handled at the higher level and not in the individual targets, but this fixes the immediate bug.)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8931
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
#include <stdio.h>
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
#include "SDL.h"
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
/* !!! FIXME: rewrite this to be wired in to test framework. */
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
8946
c9592936dffc Added SDL_HITTEST_RESIZE_*, and implemented for X11.
Ionut Leonte <ionut.leonte@gmail.com>
parents: 8940
diff changeset
     6
#define RESIZE_BORDER 20
c9592936dffc Added SDL_HITTEST_RESIZE_*, and implemented for X11.
Ionut Leonte <ionut.leonte@gmail.com>
parents: 8940
diff changeset
     7
8935
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
     8
const SDL_Rect drag_areas[] = {
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
     9
    { 20, 20, 100, 100 },
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    10
    { 200, 70, 100, 100 },
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    11
    { 400, 90, 100, 100 }
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    12
};
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    13
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    14
static const SDL_Rect *areas = drag_areas;
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    15
static int numareas = SDL_arraysize(drag_areas);
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    16
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    17
static SDL_HitTestResult
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    18
hitTest(SDL_Window *window, const SDL_Point *pt, void *data)
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    19
{
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    20
    int i;
8946
c9592936dffc Added SDL_HITTEST_RESIZE_*, and implemented for X11.
Ionut Leonte <ionut.leonte@gmail.com>
parents: 8940
diff changeset
    21
    int w, h;
c9592936dffc Added SDL_HITTEST_RESIZE_*, and implemented for X11.
Ionut Leonte <ionut.leonte@gmail.com>
parents: 8940
diff changeset
    22
8935
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    23
    for (i = 0; i < numareas; i++) {
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    24
        if (SDL_PointInRect(pt, &areas[i])) {
8939
caaa7653f02b Make some printf() calls into SDL_Log() so I can see them on Windows. :)
Ryan C. Gordon <icculus@icculus.org>
parents: 8936
diff changeset
    25
            SDL_Log("HIT-TEST: DRAGGABLE\n");
8935
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    26
            return SDL_HITTEST_DRAGGABLE;
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    27
        }
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    28
    }
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    29
8946
c9592936dffc Added SDL_HITTEST_RESIZE_*, and implemented for X11.
Ionut Leonte <ionut.leonte@gmail.com>
parents: 8940
diff changeset
    30
    SDL_GetWindowSize(window, &w, &h);
8947
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    31
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    32
    #define REPORT_RESIZE_HIT(name) { \
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    33
        SDL_Log("HIT-TEST: RESIZE_" #name "\n"); \
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    34
        return SDL_HITTEST_RESIZE_##name; \
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    35
    }
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    36
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    37
    if (pt->x < RESIZE_BORDER && pt->y < RESIZE_BORDER) {
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    38
        REPORT_RESIZE_HIT(TOPLEFT);
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    39
    } else if (pt->x > RESIZE_BORDER && pt->x < w - RESIZE_BORDER && pt->y < RESIZE_BORDER) {
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    40
        REPORT_RESIZE_HIT(TOP);
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    41
    } else if (pt->x > w - RESIZE_BORDER && pt->y < RESIZE_BORDER) {
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    42
        REPORT_RESIZE_HIT(TOPRIGHT);
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    43
    } else if (pt->x > w - RESIZE_BORDER && pt->y > RESIZE_BORDER && pt->y < h - RESIZE_BORDER) {
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    44
        REPORT_RESIZE_HIT(RIGHT);
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    45
    } else if (pt->x > w - RESIZE_BORDER && pt->y > h - RESIZE_BORDER) {
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    46
        REPORT_RESIZE_HIT(BOTTOMRIGHT);
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    47
    } else if (pt->x < w - RESIZE_BORDER && pt->x > RESIZE_BORDER && pt->y > h - RESIZE_BORDER) {
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    48
        REPORT_RESIZE_HIT(BOTTOM);
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    49
    } else if (pt->x < RESIZE_BORDER && pt->y > h - RESIZE_BORDER) {
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    50
        REPORT_RESIZE_HIT(BOTTOMLEFT);
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    51
    } else if (pt->x < RESIZE_BORDER && pt->y < h - RESIZE_BORDER && pt->y > RESIZE_BORDER) {
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    52
        REPORT_RESIZE_HIT(LEFT);
14d3e9f93c16 Minor tweaks to testhittesting.
Ryan C. Gordon <icculus@icculus.org>
parents: 8946
diff changeset
    53
    }
8946
c9592936dffc Added SDL_HITTEST_RESIZE_*, and implemented for X11.
Ionut Leonte <ionut.leonte@gmail.com>
parents: 8940
diff changeset
    54
8939
caaa7653f02b Make some printf() calls into SDL_Log() so I can see them on Windows. :)
Ryan C. Gordon <icculus@icculus.org>
parents: 8936
diff changeset
    55
    SDL_Log("HIT-TEST: NORMAL\n");
8935
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    56
    return SDL_HITTEST_NORMAL;
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    57
}
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    58
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    59
8931
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    60
int main(int argc, char **argv)
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    61
{
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    62
    int done = 0;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    63
    SDL_Window *window;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    64
    SDL_Renderer *renderer;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    65
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    66
    /* !!! FIXME: check for errors. */
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    67
    SDL_Init(SDL_INIT_VIDEO);
8946
c9592936dffc Added SDL_HITTEST_RESIZE_*, and implemented for X11.
Ionut Leonte <ionut.leonte@gmail.com>
parents: 8940
diff changeset
    68
    window = SDL_CreateWindow("Drag the red boxes", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE);
8931
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    69
    renderer = SDL_CreateRenderer(window, -1, 0);
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    70
8935
9d2f0236322b Changed drag area API to a hit-testing API.
Ryan C. Gordon <icculus@icculus.org>
parents: 8931
diff changeset
    71
    if (SDL_SetWindowHitTest(window, hitTest, NULL) == -1) {
8939
caaa7653f02b Make some printf() calls into SDL_Log() so I can see them on Windows. :)
Ryan C. Gordon <icculus@icculus.org>
parents: 8936
diff changeset
    72
        SDL_Log("Enabling hit-testing failed!\n");
8931
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    73
        SDL_Quit();
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    74
        return 1;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    75
    }
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    76
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    77
    while (!done)
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    78
    {
8940
850e149d02d8 Patched to compile on Visual Studio.
Ryan C. Gordon <icculus@icculus.org>
parents: 8939
diff changeset
    79
        SDL_Event e;
850e149d02d8 Patched to compile on Visual Studio.
Ryan C. Gordon <icculus@icculus.org>
parents: 8939
diff changeset
    80
        int nothing_to_do = 1;
850e149d02d8 Patched to compile on Visual Studio.
Ryan C. Gordon <icculus@icculus.org>
parents: 8939
diff changeset
    81
8931
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    82
        SDL_SetRenderDrawColor(renderer, 0, 0, 127, 255);
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    83
        SDL_RenderClear(renderer);
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    84
        SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    85
        SDL_RenderFillRects(renderer, areas, SDL_arraysize(drag_areas));
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    86
        SDL_RenderPresent(renderer);
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    87
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    88
        while (SDL_PollEvent(&e)) {
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    89
            nothing_to_do = 0;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    90
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    91
            switch (e.type)
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    92
            {
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    93
                case SDL_MOUSEBUTTONDOWN:
8939
caaa7653f02b Make some printf() calls into SDL_Log() so I can see them on Windows. :)
Ryan C. Gordon <icculus@icculus.org>
parents: 8936
diff changeset
    94
                    SDL_Log("button down!\n");
8931
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    95
                    break;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    97
                case SDL_MOUSEBUTTONUP:
8939
caaa7653f02b Make some printf() calls into SDL_Log() so I can see them on Windows. :)
Ryan C. Gordon <icculus@icculus.org>
parents: 8936
diff changeset
    98
                    SDL_Log("button up!\n");
8931
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    99
                    break;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   100
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   101
                case SDL_WINDOWEVENT:
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   102
                    if (e.window.event == SDL_WINDOWEVENT_MOVED) {
8939
caaa7653f02b Make some printf() calls into SDL_Log() so I can see them on Windows. :)
Ryan C. Gordon <icculus@icculus.org>
parents: 8936
diff changeset
   103
                        SDL_Log("Window event moved to (%d, %d)!\n", (int) e.window.data1, (int) e.window.data2);
8931
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   104
                    }
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
                    break;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   106
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   107
                case SDL_KEYDOWN:
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   108
                    if (e.key.keysym.sym == SDLK_ESCAPE) {
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   109
                        done = 1;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
                    } else if (e.key.keysym.sym == SDLK_x) {
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
                        if (!areas) {
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
                            areas = drag_areas;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
                            numareas = SDL_arraysize(drag_areas);
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
                        } else {
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
                            areas = NULL;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   116
                            numareas = 0;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
                        }
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
                    }
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   119
                    break;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
                case SDL_QUIT:
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
                    done = 1;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
                    break;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
            }
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
        }
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   127
        if (nothing_to_do) {
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
            SDL_Delay(50);
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
        }
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
    }
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
    SDL_Quit();
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
    return 0;
44d8a2f4b431 First shot at SDL_SetWindowDragAreas().
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
}