src/video/android/SDL_androidwindow.c
author Sam Lantinga <slouken@libsdl.org>
Thu, 13 Jan 2011 18:31:15 -0800
changeset 5001 77df56570442
parent 4998 a514bfe6952a
child 5222 c66b2a778b7e
permissions -rw-r--r--
Added "mouse" support for the Android touch screen
slouken@4998
     1
/*
slouken@4998
     2
    SDL - Simple DirectMedia Layer
slouken@4998
     3
    Copyright (C) 1997-2010 Sam Lantinga
slouken@4998
     4
slouken@4998
     5
    This library is free software; you can redistribute it and/or
slouken@4998
     6
    modify it under the terms of the GNU Lesser General Public
slouken@4998
     7
    License as published by the Free Software Foundation; either
slouken@4998
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@4998
     9
slouken@4998
    10
    This library is distributed in the hope that it will be useful,
slouken@4998
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@4998
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@4998
    13
    Lesser General Public License for more details.
slouken@4998
    14
slouken@4998
    15
    You should have received a copy of the GNU Lesser General Public
slouken@4998
    16
    License along with this library; if not, write to the Free Software
slouken@4998
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@4998
    18
slouken@4998
    19
    Sam Lantinga
slouken@4998
    20
    slouken@libsdl.org
slouken@4998
    21
*/
slouken@4998
    22
#include "SDL_config.h"
slouken@4998
    23
slouken@4998
    24
#include "../SDL_sysvideo.h"
slouken@4998
    25
slouken@4998
    26
#include "SDL_androidvideo.h"
slouken@4998
    27
#include "SDL_androidwindow.h"
slouken@4998
    28
slouken@4998
    29
int
slouken@4998
    30
Android_CreateWindow(_THIS, SDL_Window * window)
slouken@4998
    31
{
slouken@5001
    32
    if (Android_Window) {
slouken@5001
    33
        SDL_SetError("Android only supports one window");
slouken@5001
    34
        return -1;
slouken@5001
    35
    }
slouken@5001
    36
    Android_Window = window;
slouken@5001
    37
slouken@4998
    38
    /* Adjust the window data to match the screen */
slouken@4998
    39
    window->x = 0;
slouken@4998
    40
    window->y = 0;
slouken@4998
    41
    window->w = Android_ScreenWidth;
slouken@4998
    42
    window->h = Android_ScreenHeight;
slouken@4998
    43
slouken@4998
    44
    return 0;
slouken@4998
    45
}
slouken@4998
    46
slouken@4998
    47
void
slouken@4998
    48
Android_SetWindowTitle(_THIS, SDL_Window * window)
slouken@4998
    49
{
slouken@4998
    50
    Android_JNI_SetActivityTitle(window->title);
slouken@4998
    51
}
slouken@4998
    52
slouken@4998
    53
void
slouken@4998
    54
Android_DestroyWindow(_THIS, SDL_Window * window)
slouken@4998
    55
{
slouken@5001
    56
    if (window == Android_Window) {
slouken@5001
    57
        Android_Window = NULL;
slouken@5001
    58
    }
slouken@4998
    59
}
slouken@4998
    60
slouken@4998
    61
/* vi: set ts=4 sw=4 expandtab: */