test/testbounds.c
changeset 10019 36f7e8084508
child 10152 4960666f31ac
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/testbounds.c	Mon Jan 04 23:52:40 2016 -0500
     1.3 @@ -0,0 +1,39 @@
     1.4 +/*
     1.5 +  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
     1.6 +
     1.7 +  This software is provided 'as-is', without any express or implied
     1.8 +  warranty.  In no event will the authors be held liable for any damages
     1.9 +  arising from the use of this software.
    1.10 +
    1.11 +  Permission is granted to anyone to use this software for any purpose,
    1.12 +  including commercial applications, and to alter it and redistribute it
    1.13 +  freely.
    1.14 +*/
    1.15 +
    1.16 +#include "SDL.h"
    1.17 +
    1.18 +int main(int argc, char **argv)
    1.19 +{
    1.20 +    int total, i;
    1.21 +
    1.22 +    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
    1.23 +        SDL_Log("SDL_Init(SDL_INIT_VIDEO) failed: %s", SDL_GetError());
    1.24 +    }
    1.25 +
    1.26 +    total = SDL_GetNumVideoDisplays();
    1.27 +    for (i = 0; i < total; i++) {
    1.28 +        SDL_Rect bounds = { -1,-1,-1,-1 }, usable = { -1,-1,-1,-1 };
    1.29 +        SDL_GetDisplayBounds(i, &bounds);
    1.30 +        SDL_GetDisplayUsableBounds(i, &usable);
    1.31 +        SDL_Log("Display #%d ('%s'): bounds={(%d,%d),%dx%d}, usable={(%d,%d),%dx%d}",
    1.32 +                i, SDL_GetDisplayName(i),
    1.33 +                bounds.x, bounds.y, bounds.w, bounds.h,
    1.34 +                usable.x, usable.y, usable.w, usable.h);
    1.35 +    }
    1.36 +
    1.37 +    SDL_Quit();
    1.38 +    return 0;
    1.39 +}
    1.40 +
    1.41 +/* vi: set ts=4 sw=4 expandtab: */
    1.42 +