src/video/android/SDL_androidgl.c
author Sam Lantinga <slouken@libsdl.org>
Fri, 08 Apr 2011 13:03:26 -0700
changeset 5535 96594ac5fd1a
parent 5262 b530ef003506
child 5992 f4b73deb9d26
permissions -rw-r--r--
SDL 1.3 is now under the zlib license.
     1 /*
     2   Simple DirectMedia Layer
     3   Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
     4 
     5   This software is provided 'as-is', without any express or implied
     6   warranty.  In no event will the authors be held liable for any damages
     7   arising from the use of this software.
     8 
     9   Permission is granted to anyone to use this software for any purpose,
    10   including commercial applications, and to alter it and redistribute it
    11   freely, subject to the following restrictions:
    12 
    13   1. The origin of this software must not be misrepresented; you must not
    14      claim that you wrote the original software. If you use this software
    15      in a product, an acknowledgment in the product documentation would be
    16      appreciated but is not required.
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    21 #include "SDL_config.h"
    22 
    23 /* Android SDL video driver implementation */
    24 
    25 #include "SDL_video.h"
    26 
    27 #include "SDL_androidvideo.h"
    28 #include "../../core/android/SDL_android.h"
    29 
    30 #include <android/log.h>
    31 
    32 
    33 /* GL functions */
    34 int
    35 Android_GL_LoadLibrary(_THIS, const char *path)
    36 {
    37     __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n");
    38     return 0;
    39 }
    40 
    41 void *
    42 Android_GL_GetProcAddress(_THIS, const char *proc)
    43 {
    44     __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetProcAddress\n");
    45     return 0;
    46 }
    47 
    48 void
    49 Android_GL_UnloadLibrary(_THIS)
    50 {
    51     __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_UnloadLibrary\n");
    52 }
    53 
    54 SDL_GLContext
    55 Android_GL_CreateContext(_THIS, SDL_Window * window)
    56 {
    57     if (!Android_JNI_CreateContext(_this->gl_config.major_version,
    58                                    _this->gl_config.minor_version)) {
    59         SDL_SetError("Couldn't create OpenGL context - see Android log for details");
    60         return NULL;
    61     }
    62     return (SDL_GLContext)1;
    63 }
    64 
    65 int
    66 Android_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
    67 {
    68     /* There's only one context, nothing to do... */
    69     return 0;
    70 }
    71 
    72 int
    73 Android_GL_SetSwapInterval(_THIS, int interval)
    74 {
    75     __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SetSwapInterval\n");
    76     return 0;
    77 }
    78 
    79 int
    80 Android_GL_GetSwapInterval(_THIS)
    81 {
    82     __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetSwapInterval\n");
    83     return 0;
    84 }
    85 
    86 void
    87 Android_GL_SwapWindow(_THIS, SDL_Window * window)
    88 {
    89     Android_JNI_SwapWindow();
    90 }
    91 
    92 void
    93 Android_GL_DeleteContext(_THIS, SDL_GLContext context)
    94 {
    95     __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n");
    96 }
    97 
    98 /* vi: set ts=4 sw=4 expandtab: */