src/video/android/SDL_androidgl.c
author Sam Lantinga <slouken@libsdl.org>
Fri, 09 Dec 2016 05:12:27 -0800
changeset 10695 e54fce44f677
parent 10672 10fb0ebc4fbf
child 10737 3406a0f8b041
permissions -rw-r--r--
Fixed a bunch of SwapWindow calls that needed their return value updated
paul@4701
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@9998
     3
  Copyright (C) 1997-2016 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@10672
    32
#include "SDL_androidgl.h"
slouken@5090
    33
#include "../../core/android/SDL_android.h"
paul@4701
    34
paul@4707
    35
#include <android/log.h>
paul@4701
    36
icculus@5992
    37
#include <dlfcn.h>
icculus@5992
    38
gabomdq@7659
    39
SDL_EGL_CreateContext_impl(Android)
gabomdq@7659
    40
SDL_EGL_MakeCurrent_impl(Android)
paul@4701
    41
slouken@10695
    42
int
gabomdq@7659
    43
Android_GLES_SwapWindow(_THIS, SDL_Window * window)
slouken@4989
    44
{
gabomdq@8700
    45
    /* The following two calls existed in the original Java code
gabomdq@8700
    46
     * If you happen to have a device that's affected by their removal,
gabomdq@8700
    47
     * please report to Bugzilla. -- Gabriel
gabomdq@8700
    48
     */
gabomdq@8700
    49
    
gabomdq@8700
    50
    /*_this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE);
gabomdq@8700
    51
    _this->egl_data->eglWaitGL();*/
slouken@10695
    52
    return SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);
paul@4701
    53
}
paul@4701
    54
slouken@4989
    55
int
gabomdq@7659
    56
Android_GLES_LoadLibrary(_THIS, const char *path) {
gabomdq@7659
    57
    return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) 0);
paul@4701
    58
}
slouken@5222
    59
slouken@6044
    60
#endif /* SDL_VIDEO_DRIVER_ANDROID */
slouken@6044
    61
slouken@5222
    62
/* vi: set ts=4 sw=4 expandtab: */