src/video/android/SDL_androidgl.c
author Sam Lantinga <slouken@libsdl.org>
Tue, 26 May 2015 06:27:46 -0700
changeset 9619 b94b6d0bff0f
parent 8700 446c4e870681
child 9998 f67cf37e9cd4
permissions -rw-r--r--
Updated the copyright year to 2015
paul@4701
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@9619
     3
  Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
paul@4701
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
paul@4701
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
paul@4701
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
paul@4701
    20
*/
icculus@8093
    21
#include "../../SDL_internal.h"
paul@4701
    22
slouken@6044
    23
#if SDL_VIDEO_DRIVER_ANDROID
slouken@6044
    24
slouken@4980
    25
/* Android SDL video driver implementation */
paul@4701
    26
paul@4701
    27
#include "SDL_video.h"
gabomdq@8021
    28
#include "../SDL_egl_c.h"
gabomdq@7659
    29
#include "SDL_androidwindow.h"
paul@4701
    30
paul@4701
    31
#include "SDL_androidvideo.h"
slouken@5090
    32
#include "../../core/android/SDL_android.h"
paul@4701
    33
paul@4707
    34
#include <android/log.h>
paul@4701
    35
icculus@5992
    36
#include <dlfcn.h>
icculus@5992
    37
gabomdq@7659
    38
SDL_EGL_CreateContext_impl(Android)
gabomdq@7659
    39
SDL_EGL_MakeCurrent_impl(Android)
paul@4701
    40
gabomdq@7722
    41
void
gabomdq@7659
    42
Android_GLES_SwapWindow(_THIS, SDL_Window * window)
slouken@4989
    43
{
gabomdq@8700
    44
    /* The following two calls existed in the original Java code
gabomdq@8700
    45
     * If you happen to have a device that's affected by their removal,
gabomdq@8700
    46
     * please report to Bugzilla. -- Gabriel
gabomdq@8700
    47
     */
gabomdq@8700
    48
    
gabomdq@8700
    49
    /*_this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE);
gabomdq@8700
    50
    _this->egl_data->eglWaitGL();*/
gabomdq@7659
    51
    SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
paul@4701
    52
}
paul@4701
    53
slouken@4989
    54
int
gabomdq@7659
    55
Android_GLES_LoadLibrary(_THIS, const char *path) {
gabomdq@7659
    56
    return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) 0);
paul@4701
    57
}
slouken@5222
    58
slouken@6044
    59
#endif /* SDL_VIDEO_DRIVER_ANDROID */
slouken@6044
    60
slouken@5222
    61
/* vi: set ts=4 sw=4 expandtab: */